【发布时间】:2015-01-19 01:31:53
【问题描述】:
您好,我发现了同样的问题,但没有答案: enter link description here
我的问题是我尝试使用 matplotlib 绘制数据,它连接了第一个和最后一个数据点。我正在使用 python27 和 Windows 7。我的问题只是显示完整,所以我只显示源代码的某些部分。绘图功能如下:
def plot(x, aw,temperature):
plt.clf()
temperatureplot = plt.subplot(211)
awplot = plt.subplot(212)
temperatureplot.grid()
awplot.grid()
#set subplots
awplot.set_ylabel('water activity aw')
awplot.plot(x,aw)
awplot.margins(y=0.05) #adds a gap between maximum value and edge of diagram
temperatureplot.set_ylabel('Temperature in degree C')
temperatureplot.plot(x,temperature)
temperatureplot.margins(y=0.05)
awplot.set_xlabel('Time in [hm]')
plt.gcf().canvas.draw()
我正在使用它,因为我在 Tkinter Gui 中绘制它并且有时想刷新它。情节看起来像:
我的价值观是:
t = [161000, 161015...., 191115]
aw = [0.618,......, 0.532]
temperature = [23.7,....,24.4]
我在 t 数组中不从零开始是否有问题?
如果有人有提示或知道问题,请帮助我。
欢呼麦克斯
【问题讨论】:
-
对于被否决的人,请您解释一下您为什么这样做,以改善我以后的帖子并可能扩展问题?
标签: python matplotlib plot