[Matplotlib-users] The dpi set is useless in my picture when using matplotlib
tcaswell at gmail.com
Mon May 16 14:12:05 EDT 2016
How are you determining that the figure dpi is still 72?
ps please subscribe to the mailing list so you can post with out moderation
On Mon, May 16, 2016 at 1:53 PM tanweiwei at pku.edu.cn <tanweiwei at pku.edu.cn>
> I am learing to use matplotlib to produce high quality picture for my
> paper. The demand dpi of this magzine is 300.
> So, I wrote some example codes:
> import numpy as npimport matplotlib.pyplot as plt
> a = np.linspace(0, 10, 100)
> b = np.linspace(0, 20, 100)
> plt.plot(a, b, 'o')
> plt.savefig('fig1.jpg', dpi=300, format='jpg')
> But I got a picure whose dpi is 72, and its size is 2400*1800. I'm
> confused about this outcome. I searched the Internet and some references
> about dpi setting, but I can't solve this problem anyway.
> Also I tried those:
> matplotlib.rcParams['savefig.dpi'] = 300
> in this file, make
> *All of those is useless.*
> I think the reason why the size of produced figure is 2400*1800. Because
> (300dpi*8 inches)*(300dpi*6 inches). The default size of figure in rc file
> is 8 inches and 6 inches. But why the dpi of this figure can't be changed!
> My operating system is windows 10. Anaconda 3 helped me to install
> matplotlib module.
> *Thank for your help!*
> *Weiwei Tan*
> *Institute of Heavy Ion Physics*
> *School of Physics，Peking University *
> Matplotlib-users mailing list
> Matplotlib-users at python.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Matplotlib-users