Python 使用 Matplotlib 做图时,如何画竖直和水平的分割线?,pythonmatplotlib,作者:看看链接:ht
Python 使用 Matplotlib 做图时,如何画竖直和水平的分割线?,pythonmatplotlib,作者:看看链接:ht
作者:看看链接:https://www.zhihu.com/question/21929761/answer/164975814
来源:知乎
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。
可以使用:
vlines(x, ymin, ymax)
hlines(y, xmin, xmax)
import matplotlib.pyplot as pltimport numpy as npdef Laplacian_Prior(x, u, b): return 1.0/(2*b)*np.exp(-abs(x - u)/b)if __name__ == "__main__": x = np.arange(-10, 10, 0.01) y_1 = Laplacian_Prior(x, 0, 1) y_2 = Laplacian_Prior(x, 0, 2) y_3 = Laplacian_Prior(x, 0, 4) y_4 = Laplacian_Prior(x, -5, 4) plt.plot(x, y_1, "r-") plt.plot(x, y_2, "k-") plt.plot(x, y_3, "b-") plt.plot(x, y_4, "g-") plt.vlines(0, 0, 0.5, colors = "c", linestyles = "dashed")
Python 使用 Matplotlib 做图时,如何画竖直和水平的分割线?
相关内容
- Python结合SAP GUI Script操作sap的简易教程,pythonsap, 众
- “本办法学python” ex49,本办法学pythonex49,1.创建目录结
- python的__file__和__name__变量,__file___name_,#现在的目录结
- Python中PIL及Opencv转化,pythonpilopencv,转载:http://
- 关于python局部敏感哈希包lshash安装的问题,pythonlshash
- 四十六 Python分布式爬虫打造搜索引擎Scrapy精讲—elas
- centos 7 编译 python3.7.0,centospython3.7.0,安装编译所需库
- Vs2017 Python开发-添加虚拟环境,vs2017python,虚拟环境是代
- Python pandas.DataFrame调整列顺序及修改index名,,1. 从字典
- python匹配两个字符串中间的字符串,python匹配,问题:使
评论关闭