Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Open
Description
Matplotlib 2.0.0 seems to have changed the default legend location from "upper right" to "best" (although the documentation doesn't say this). I have noticed that this results in a severe performance penalty: several plots which would normally render in a fraction of a second now need 5-10 seconds. To make things worse, the legend location is recalculated whenever the plot is moved or zoomed. The sharex/sharey functionality which I use quite a lot makes this even slower, since all subplots are moved or zoomed simultaneously.
Code for reproduction
frompylabimport*x=linspace(0,100,100000)close("all")figure("Test",figsize=(12,8))forjinrange(9):ifj==0:ax=subplot(3,3,1)else:subplot(3,3,j+1,sharex=ax,sharey=ax)foriinrange(8):plot(x,sin(x+i*0.5),color=cm.magma(i/8),label="test")legend(fontsize="small")tight_layout()show()
Matplotlib version
- Matplotlib 2.0.0 (installed with pip)
- Python 3.6.0 (compiled from source)
- Platform: Linux (CentOS 6)