plt.show() is probably triggering the macosx backend to render the figure, which does not have this limitation. Saving PNG files (and displaying images in %matplotlib inline mode in the Jupyter notebook) uses the agg backend, which does unfortunately have a hard-coded limit on the number of points in a line. You could try breaking your line up into pieces (we don't do this internally because it's difficult to do it in the general case), or consider other ways to reduce your data (seeing 2 million discrete points will be very difficult anyway).
I assume that this plot is super jagged? My guess is that there is something funny going on with when path simplification comes in or not. Which backend are you using?
I encountered the same problem today, on linux (python 3, matplotlib 1.5.1~rc1 from debian).
I'm plotting large time series (101k points). The line plot is dense enough that it ends up looking like a filled area between 2 jagged curves, which is exactly the desired effect, without having to generate the area myself.
I can show() the plot just fine using the Qt4Agg backend, but cannot savefig().
Or, should I clarify, I can show() it as along as the window size is small enough. I discovered now that I cannot get it big enough to screenshot either...
Activity
mdboom commented on Jan 25, 2016
plt.show() is probably triggering the macosx backend to render the figure, which does not have this limitation. Saving PNG files (and displaying images in %matplotlib inline mode in the Jupyter notebook) uses the agg backend, which does unfortunately have a hard-coded limit on the number of points in a line. You could try breaking your line up into pieces (we don't do this internally because it's difficult to do it in the general case), or consider other ways to reduce your data (seeing 2 million discrete points will be very difficult anyway).
tacaswell commented on Jan 25, 2016
I assume that this plot is super jagged? My guess is that there is something funny going on with when path simplification comes in or not. Which backend are you using?
davidrpugh commented on Jan 25, 2016
@tacaswell Using the plt.get_backend() command returns...
'module://ipykernel.pylab.backend_inline'
...so inline plotting.
wavexx commented on Feb 2, 2016
I encountered the same problem today, on linux (python 3, matplotlib 1.5.1~rc1 from debian).
I'm plotting large time series (101k points). The line plot is dense enough that it ends up looking like a filled area between 2 jagged curves, which is exactly the desired effect, without having to generate the area myself.
I can show() the plot just fine using the Qt4Agg backend, but cannot savefig().
wavexx commented on Feb 2, 2016
Or, should I clarify, I can show() it as along as the window size is small enough. I discovered now that I cannot get it big enough to screenshot either...
tacaswell commented on Feb 3, 2016
Try setting mpl.rcParams['agg.path.chunksize'] = 10000 or so.
wavexx commented on Feb 4, 2016
On 03/02/16 05:35, Thomas A Caswell wrote:
That does the trick (both for Qt4Agg and plain Agg).
Maybe that should go as a commented note in the default matplotlibrc.
anntzer commented on Sep 11, 2017
This was documented in #8176.
abatoolyn commented on Nov 27, 2018
Im using
votes.plot(x='Lat', y='Lon')
to plot points as a map
What can I do to overcome the exceeded cell block limit?