You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you load a stylesheet with a figure.dpi setting, then the dpi setting is not honored in the first figure. (It is honored in subsequent figures).
Code for reproduction
importnumpyasnpimportmatplotlibasmplimportmatplotlib.pyplotaspltfrompathlibimportPathcfgdir=mpl.get_configdir()
# --- First create a custom style file with just a dpi setting ---p=Path(cfgdir)
stylelib= (p/'stylelib')
stylelib.mkdir(exist_ok=True)
path=stylelib/'mplbug.mplstyle'path.write_text("figure.dpi: 200")
plt.style.reload_library()
x=np.cos(np.linspace(0,4*np.pi,200))
plt.style.use('mplbug')
plt.plot(x)
Actual outcome
when i run this exact code two times in a row in a jupyter notebook, then the figure size is not the same the two times. It is wrong in the first figure.
Expected outcome
I expect the figure to be big the first time and all subsequent times.
Additional information
No response
Operating system
Windows
Matplotlib Version
3.5.2
Matplotlib Backend
module://ipykernel.pylab.backend_inline
Python version
3.8.5
Jupyter version
6.1.4
Installation
conda
The text was updated successfully, but these errors were encountered:
Bug summary
When you load a stylesheet with a figure.dpi setting, then the dpi setting is not honored in the first figure. (It is honored in subsequent figures).
Code for reproduction
Actual outcome
when i run this exact code two times in a row in a jupyter notebook, then the figure size is not the same the two times. It is wrong in the first figure.
Expected outcome
I expect the figure to be big the first time and all subsequent times.
Additional information
No response
Operating system
Windows
Matplotlib Version
3.5.2
Matplotlib Backend
module://ipykernel.pylab.backend_inline
Python version
3.8.5
Jupyter version
6.1.4
Installation
conda
The text was updated successfully, but these errors were encountered: