Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Bug]: Zoom und pan not working after writing pdf pages.  #27865

Closed
@Erwin-Wert

Description

@Erwin-Wert

Bug summary

Ladies and Gentlemen,
Zoom und pan is not working after writing pdf pages.
Within matplotlib version 3.7.5 it is working.
In e.g. 3.8.3 it does not react any more.

Code for reproduction

import matplotlib.pyplot as plt
from matplotlib.backends.backend_pdf import PdfPages
fig, ax = plt.subplots()
ax.plot([1, 2, 3], [4, 5, 6])
filename = "test4.pdf"
with PdfPages(filename) as pdf:
    fig.show()
    pdf.savefig() # <== if you comment this line, then zoom is working fine. However it is not getting stored.

Actual outcome

zoom not possible

Expected outcome

zoom is possible

Additional information

In earlier versions it has been working fine.
It is also not working within jupyterlab.
It was testet in Spyder IDE 5.5.1 and IDLE(Python 3.12 64-bit)
I take the earlier matplotlib version instead.

Operating system

Windows 7,

Matplotlib Version

3.8.3

Matplotlib Backend

QtAgg

Python version

Python 3.12.2 64-bit

Jupyter version

4.1.2

Installation

pip

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions