Closed
Description
Bug summary
First invocation of plt.plot()
resets mpl.rcParams['figure.dpi']
.
Code for reproduction
# Only tested in Jupyter
import matplotlib as mpl
import matplotlib.pyplot as plt
mpl.rcParams['figure.dpi'] = 300
print(mpl.rcParams['figure.dpi'])
plt.plot()
print(mpl.rcParams['figure.dpi'])
Actual outcome
300.0
72.0
Expected outcome
300.0
300.0
Additional information
This happens only at the very first invocation of plt.plot()
, while on subsequent plt.plot()
calls mpl.rcParams['figure.dpi']
will no longer be overwritten.
Other rcParams
values seem not to be affected (but I've not tested them all).
I have never observed this behavior in any of the previous matplotlib versions, so the bug must have been introduced in the latest version (3.5.2).
Operating system
Windows 10
Matplotlib Version
3.5.2
Matplotlib Backend
module://matplotlib_inline.backend_inline
Python version
Python 3.9.12
Jupyter version
3.4.0
Installation
conda