使用2个数据帧绘制图形时,图形线消失

时间:2015-10-05 14:33:52

标签: python python-2.7 pandas matplotlib

绘制df1['Volume (BTC)'].plot(label='EUR Volume')后,第一个子图(ax1)的图形线完全消失。我做错了吗?

import pandas as pd
import matplotlib.pyplot as plt
from matplotlib import style
style.use('ggplot')

df = pd.read_csv('eurPrice.csv', index_col='Timestamp', parse_dates=True)
ax1 = plt.subplot(2, 1, 1)
df['sourceA'].plot(label='sourceA')
df['sourceB'].plot(label='sourceB')
plt.legend()

ax2 = plt.subplot(2, 1, 2, sharex = ax1)
df1 = pd.read_csv('eurVolume.csv', index_col='Timestamp', parse_dates=True)
df1['Volume (BTC)'].plot(label='EUR Volume')
plt.legend()

plt.show()

enter image description here

0 个答案:

没有答案