Bala subramanian, on 2011-01-21 12:17, wrote:
Did you try saving the figure with same dpi ?. Try the following.
> I need to create a huge range of plots with need to fit into a report
> (OpenOffice or Word). In order to save the work of manual resizing them when
> dragged and dropped, I wanted to preset a correct figure size with a nice
> pylab.rcParams['figure.figsize'] = 5,4
> pylab.rcParams['figure.dpi'] = 300
> Now, the created figure has a size of 500x400 pixels, and when I import it
> into a word processor, its dimensions are reported as 12.7x10.16cm², which
> matches the figsize definition. Yet, the resulting images are pretty much
> How can I increase the resolution, or what am I doing wrong?
As Bala alluded - there's a difference between display dpi and
the file saving dpi. Your change to rcParams only affected the
displayed resolution, not the resolution of saved files.
Quoting from .matplotlibrc
# the default savefig params can be different from the display params
# Eg, you may want a higher resolution, or to make the figure
# background white
#savefig.dpi : 100 # figure dots per inch
So try playing around with that parameter (which is what you're
doing if you call plt.savefig('name', dpi=300)
On Fri, Jan 21, 2011 at 9:08 AM, Daniel Mader < > danielstefanmader@...982...> wrote:
314 address only used for lists, off-list direct email at:
http://pirsquared.org | GPG/PGP key id: 0x0F3E28F7