Frage

I have on Mac OS X PyCharm with Enthought set up as interpreter:

~/Library/Enthought/Canopy_64bit/User

However, it does not show any of the plots from matplotlib.

import pandas as pd
from numpy import *
import matplotlib.pyplot as plt
ts = pd.Series(random.randn(1000), index=pd.date_range('1/1/2000', periods=1000))
ts = ts.cumsum()
ts.plot()

This just gives me Out[124]: <matplotlib.axes.AxesSubplot at 0x10dd29f90>. It does not show the plot, nor does it do anything else. No error, nothing.

War es hilfreich?

Lösung

You're missing the call to the show() function that will display the plot items.

import pandas as pd
from numpy import *
import matplotlib.pyplot as plt
ts = pd.Series(random.randn(1000), index=pd.date_range('1/1/2000', periods=1000))
ts = ts.cumsum()
ts.plot()
plt.show()

PyCharm is more than likely not configured in interactive mode with matplotlib.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top