Skip to content

[Bug]: pickling and unpickling hidpi a qt figure that has been already shown doubles its physical size #27224

Open
@anntzer

Description

@anntzer

Bug summary

All's in the title.

Code for reproduction

# Run this from a computer with a hidpi display.
from pylab import *; import pickle
fig = figure(figsize=(5, 4))
show(block=False)
copy = pickle.loads(pickle.dumps(fig))
show(block=False)
print(fig.get_size_inches(), c.get_size_inches())

Actual outcome

[5. 4.] [10. 8.]
... and the second figure is indeed twice bigger.

Expected outcome

[5. 4.] [5. 4.]
... and two figures with the same size.

Additional information

Bisects to #23476.

Operating system

macOS

Matplotlib Version

3.8

Matplotlib Backend

qtagg

Python version

3.12

Jupyter version

ENOSUCHLIB

Installation

git checkout

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