您好,我在绘制从16000到17000的条形图x值时遇到问题,我不确定如何修复它。先谢谢你
plt.title("Site Data Availability")
plt.xlabel("Julian Year Dates (YYDDD)")
plt.ylabel("Instrument Sites")
plt.axhline(y="BTK", color='r', linestyle='-', linewidth=10)
plt.axhline(y="BTK", xmin=16000, xmax=17000, color='b', linestyle='-', linewidth=10) #issues with this line
plt.xlim(15000, 20000)
plt.xticks(rotation=90)
plt.show()
编辑以下内容的行:
解释:
xmin
和xmax
必须是介于0和1之间的值在您的代码中,0由15000表示,1对应于20000
可以使用线性插值器,找出16000(0.2)和17000(0.4)的百分比
使用
hlines
:输出:
其中
相关问题 更多 >
编程相关推荐