On Wednesday 31 March 2010 09:24:10 yogesh karpate wrote:
> Dear All,
>                I am using one image of 235X130 and plotting the curve on
> it, now when i save it it goes  in the resoltuion  of 800X600,
> I want to keep the resolution intact.What can be done for that to keep the
> resolution same?
> I am using
> savefig('/home/jaguar/Softwares/Development/Python/bunty.png')
> Thanks in advance!
> Regards
> Yogesh

Hi Yogesh,

You can adjust the resolution by changing the figure size and the dpi in 
savefig.

Keyword of figure:
 *figsize* width x height in inches; defaults to rc figure.figsize

Keyword of savefig:
  *dpi*: [ None | scalar > 0 ]
            The resolution in dots per inch.  If *None* it will default to
            the value ``savefig.dpi`` in the matplotlibrc file.

e.g.
import matplotlib
matplotlib.use('Agg')
from matplotlib import pyplot as plt

# aim: 235X130
fig = plt.figure(figsize=(23.5, 13.0))
ax = plt.axes([0.0, 0.0, 1.0, 1.0])
ax.plot([1, 2, 4], lw=5)
ax.set_xticks([])
ax.set_yticks([])

fig.savefig('test.png', dpi=10)

Kind regards,
Matthias

------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to