Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Figure resize when saving a plot #8736

Labels
GUI: QtGood first issueOpen a pull request against these issues if there are no active ones!
Milestone
@rayosborn

Description

@rayosborn

Bug report

Bug summary

Theprint_figure function in theFigureCanvasBase class records the current figure's dpi, sets it to the requested dpi for the saved figure, and then resets it to the original. Setting the dpi invokes a property function,_set_dpi that calls the figure'sset_size_inches method, which then triggers a resize of the figure manager.

This resize is not evident when I use the standard Pyplot commands within a Qt console, presumably because the plot size doesn't change. However, I have embedded the Matplotlib figure in a PyQt GUI where I don't have the toolbar in the same widget, and it causes a noticeable size change for a fraction of a second before the second dpi reset restores the old size.

Possible solution

I would like to suggest that theFigureCanvasBaseprint_figure function should not invoke the dpi property, but set and then reset the figure's hidden variable,_dpi, which will not trigger the redundant canvas resize. I can submit a pull request, but I wanted to check if there would be side effects.

Matplotlib version

  • Matplotlib Version: 2.0.2
  • Operating System: Mac OS 10.12.5
  • Python Version: 2.7.11
  • PyQt 4.8.7

Metadata

Metadata

Assignees

No one assigned

    Labels

    GUI: QtGood first issueOpen a pull request against these issues if there are no active ones!

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp