Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[Bug]: First invocation of plt.plot() resets mpl.rcParams['figure.dpi'] #23007

Copy link
Copy link
Closed
@emazep

Description

@emazep
Issue body actions

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.