Is there a way to force the .plot
method of a pandas Series to generate a new figure, instead of trying to plot on the currently open figure?
I currently create a new figure using plt.figure()
or using plt.subplots
and passing the axis, but for quick plots from the interactive console it would be great to simply use the .plot
method without extra lines of code.
I wonder if there are configs in pandas that can be changed to achieve this.
I'm not aware of a config. Defining a wrapper around .plot() should do the trick, as suggested by Stop harming Monica.
def plot(s, **kwargs):
s.plot(**kwargs)
plt.show();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With