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

Skip to content

Bug in the HiDPI support in the qt5agg backend #8717

Closed
@djpine

Description

@djpine

Bug report

Bug summary

The interactive plot window is too small, but the text remains at the size that would be correct for a larger properly sized window.

It works if you go through pyplot:

fig, ax = plt.subplots(figsize=(6,4))
ax.plot([1,2,3])

but not in this example, which uses the pure OO interface.

The version of the plot saved to the file text.pdf is correctly sized.

Code for reproduction

from matplotlib.backends.backend_qt5agg \
     import FigureCanvasQTAgg as FigureCanvas
from matplotlib.figure import Figure

fig = Figure(figsize=(6, 4))
canvas = FigureCanvas(fig)
ax = fig.add_subplot(111)
ax.plot([1, 2, 3, 2, 3, 4, 3, 4, 5])
ax.set_title('A simple plot')
ax.grid(True)
ax.set_xlabel('time')
ax.set_ylabel('volts')
canvas.print_figure('test.pdf')
canvas.show()

Actual outcome

screen shot 2017-06-04 at 2 43 05 pm

Expected outcome

screen shot 2017-06-04 at 2 52 48 pm

Matplotlib version

  • Operating System: MacOS Sierra 10.12.5
  • Matplotlib Version: 2.0.2
  • Python Version: 3.6.1
  • Jupyter Version (if applicable):
  • Other Libraries:

Installed with conda (default)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions