我正在尝试显示曲线。脓肿是日期,纵坐标是双值(在本例中为幂)。 数据提供的日期不相同。但当两个日期匹配时,添加的第二组数据将叠加在前一组数据上
示例1:FR添加在DE之后,数据量减少4倍
示例2:DE添加在FR之后,数据量增加了4倍。
我当前运行的代码是:
# Clean figure
fig = plt.figure()
for country in ['DE', 'FR']:
production = getProduction(
country=country,
start=start,
end=end,
session=session,
verbose=False,
debug=False)
allTimeseries = production['all']['timeseries']
print(allTimeseries)
timestamps = []
values = []
for date in allTimeseries.keys():
timestamps.append(date)
values.append(allTimeseries[date]['power']['quantity'])
# Add the plot to the figure
plt.plot_date(timestamps, values, label=country, antialiased=True)
plt.xticks(rotation=30, ha="right")
plt.legend(loc='upper left', ncol=1)
# plt.show()
plt.tight_layout()
plt.savefig('test.png', dpi=fig.dpi)
如何防止两个系列堆叠
目前没有回答
相关问题 更多 >
编程相关推荐