我在matplotlib的loglog图中使用axvline绘制垂直线时遇到了一个问题。在
第一个问题是垂直线没有出现在正确的位置。在
第二个可能相关的问题是,当我放大或平移绘图时,垂直线只是停留在原位,并且没有通过平移(滑动绘图)或放大到绘图进行适当的转换。在
我的代码如下所示:
import numpy as np
import matplotlib.pyplot as plt
f, axes = plt.subplots(1, sharex=True, sharey=True)
axes.loglog(frqs,F_in,label="Input")
axes.loglog(frqs,F_out,label="Output")
axes.autoscale(enable=True, axis='x', tight=True)
axes.set_title("Input and Output Spectrum")
axes.legend()
axes.axvline(x=0.01, color='k')
不幸的是,黑色/灰色垂直线未显示在0.01处,而是介于0.01和0.1之间(其他垂直线也不在正确位置):
另外,现在如果我放大图像,数据会适当放大,但垂直线保持不变。在
其他信息:
我尝试升级到matplotlib 1.5.3,但是问题没有改变。在
目前没有回答
相关问题 更多 >
编程相关推荐