Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Description
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 theFigureCanvasBase
print_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