Change resolution of Matplotlib Figure window when saving plot?

Viewed 22955

I'm using Windows XP v3/Python 2.7 with Canopy and Anaconda package managers/editors.

I am using Python/Matplotlib to produce some Bland-Altman plots (statistical scatter plots) for publication.

After processing the data, the plt.show() command opens a new "Figure" window containing the plot, which looks fine.

I want to be able to use the dynamic pan and zoom commands in this window to interactively optimise the appearance of my plot, then save it as it appears in the window as a high resolution press-quality png image (400-600 dpi, 7 x 5 inches).

The default setting for saving images from the "Figure" window appears to be set to screen resolution (800 x 600 pixels), and I cannot find any options in this window which allow me to change these settings.

I've read other posts on this forum which explain how to directly save a plot from Python in higher resolution by using the following commands to manipulate dpi and image size, e.g.:

plt.figure(figsize=(18, 12), dpi=400)
plt.savefig("myplot.png", dpi = 400)

However, this is not the solution that I'm looking for; as I want to be able to modify the plot using the dynamic pan and zoom features of the "Figure" window before saving in a higher resolution than the default screen resolution.

I'd be grateful for your help.

Many thanks in anticipation & Happy New Year.

Dave (UK)

3 Answers

I had this issue in spyder and found changing the value in Preferences > iPython Console > Inline Backend > Resolution changes the resolution when I save figures from the built in window viewing application.

Related