2024-09-30 20:35:25 发布
网友
我是matplotlib的pyplot的初学者,想知道如何在柱状图的条形图之间获得黑线。我做了一些谷歌搜索和others were seeming to get this behavior开箱即用的命令。在
在matplotlib版本2中,直方图中的透明边成为默认值(Reference),要修改它,只需将edgecolor = 'black'参数添加到plt.hist中:
matplotlib
edgecolor = 'black'
plt.hist
plt.hist(data, 20, alpha=.5, edgecolor = 'black')
随机数据演示:
在
matplotlib
版本2中,直方图中的透明边成为默认值(Reference),要修改它,只需将edgecolor = 'black'
参数添加到plt.hist
中:随机数据演示:
^{pr2}$相关问题 更多 >
编程相关推荐