Reputation: 257
Given a pandas dataframe df, I would like to be able to do the following from terminal:
df.plot()
and have the plot show up in a window automatically, without having to also to the following:
import matplotlib.pyplot as plt;
plt.show()
Is it doable?
Upvotes: 1
Views: 45
Reputation: 4866
You can enable interactive mode when you're in the interactive Python session:
>>> import matplotlib.pyplot as plt
>>> plt.ion()
You can also make that permanent, so you don't have to type plt.ion()
every time you start a new session. Just look for "interactive" in your matplotlibrc
configuration file and change that line to this:
interactive: True
Upvotes: 2