Jae-Joon Lee wrote:
> I think this has nothing to do with dpi, but a file flushing issue.
> Try something like below with sage (note that the code does not work
> with svn version of matplotlib, i'll commit the fix soon).
>
> import matplotlib
> matplotlib.use('Agg')
> import matplotlib.pyplot as plt
> fig=plt.figure()
> plt.plot([1,2,3])
> f = open("test.png", "wb")
> plt.savefig(f, format="png", dpi=50)
> f.flush()
>
> I'll report some more details later.
>
>   



This seems to have solved the problem on the two systems on which I've 
run experiments.  Now it makes perfect sense why I was always seeing a 
corrupt file size that was a multiple of 4K (e.g., 12K instead of 13K) :) .

So just to confirm, is this a bug in matplotlib when using the 
plt.savefig(filename,dpi=72) form of calling savefig?

Thanks,

Jason

------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to