cplot icon indicating copy to clipboard operation
cplot copied to clipboard

Create new figure

Open Davide-sd opened this issue 3 years ago • 3 comments
trafficstars

When creating multiple cplots in Jupyter Notebook with ipympl and %matplotlib widget, the first plot looks good. The second will be overlayed to the first, and so on, making the plot unreadable.

This PR fixes this behaviour: a new matplotlib figure will be created everytime cplot.plot is executed.

This solves issue #60

Davide-sd avatar Feb 18 '22 17:02 Davide-sd

I'm inclined to reject this. cplot.plot() does exactly what plt.plot() does, no surprises here.

nschloe avatar Feb 18 '22 17:02 nschloe

cplot.plot() does exactly what plt.plot() does, no surprises here.

Yes, and if you want two different matplotlib figures you have to explicitly call plt.figure().

If you don't intend to support this kind of behavior, please clearly document it!

Davide-sd avatar Feb 18 '22 17:02 Davide-sd

Yes, and if you want two different matplotlib figures you have to explicitly call plt.figure().

Exactly.

nschloe avatar Feb 18 '22 17:02 nschloe