绘制 min-mean-max plot
这种类似的函数使用的是
实现,其中
是我们选择的置信区间,也可以选择
,置信区间是标准差。
根据我们实际需求,我们要求实现的
的绘制,相关文献如下[1]:
![](https://img.haomeiwen.com/i15640106/df00cb0501495803.png)
但是我们需要和
绘制区间,因此,这里需要对已经下载的
进行代码修改。
经过探索发现这个函数实现在的文件中,经过在文件中对pointplot()函数的搜索,找到_PointPlotter,再对其进行搜索,找到_CategoricalStatPlotter,发现_PointPlotter继承了_CategoricalStatPlotter这个类,因此继续搜索_CategoricalStatPlotter,找到了estimate_statistic()函数下的对
判断实现。如下图:
![](https://img.haomeiwen.com/i15640106/1afa7dfec8bdcf22.png)
这个是我已经修改好的函数,但是这样是不可以的,详见stackoverflow。根据上面的提示,我进行了如下操作:
- Github下载seaborn的原始代码。
- 放在
文件夹下。
- 在对应的
文件中修改相应的代码。
- 使用
python setup.py develop
生成对应开发者模式的代码。
这样就可以在我的电脑生成对应的图像了。如下图
![](https://img.haomeiwen.com/i15640106/6f4225b1338e7690.png)
notes:
-
为了使用这个修改版本的seaborn,必须卸载原始
路径下的seaborn,
pip uninstall seaborn
。 -
将修改后的路径加入到环境变量
中。
-
这个只能是自己能使用,如果做出贡献,可以github给作者留言,添加这样的代码。
-
如果自己有小的需求,也可以通过这样方式对库进行修改。
[1] Ayad Ali Faris B., Ahmed H. A.-S., Adrian O., Anna J. and Adriana M. (2016). "Estimation of Evapotranspiration Using SEBAL Algorithm and Landsat-8 Data—A Case Study: Tatra Mountains Region." Journal of Geological Resource and Engineering 4(6).
网友评论