2016-08-31 60 views
0

繪圖列表我有那種(系列pred_upd)的列表:在Matplotlib

enter image description here

我試圖把它們放在一起在一塊土地上這樣做:

az = series.plot(figsize=(12,8), label='o') 
ax = pred_upd.plot(style='r--', label='Dynamic Prediction'); 
ax.legend(); 
az.legend(); 
plt.plot() 
plt.show() 

我收到錯誤:

-> 2417   if isinstance(data, DataFrame): 
    2418    if x is not None: 
    2419     if com.is_integer(x) and not data.columns.holds_integer(): 

TypeError: isinstance() arg 2 must be a type or tuple of types 

我做錯了什麼?

回答

1

如果您使用的是matplotlib,我認爲您使用不正確。我無法真正推斷出什麼type是變量seriespred_upd是,但我假設它們的類型爲list(從您的示例中)。

要使用matplotlib:

import matplotlib.pyplot as plt 
plt.plot(series) 
plt.hold(True) 
plt.plot(pred_upd) 
plt.show() 

你可以把一些參數在那裏 - 但應該是格式。