Abhinav Verma wrote:
> Hello,
> 
>  It may be a very basic question, but I could not find the solution in 
> archives or the documentation. I need to make a line plot (in square 
> aspect ratio) and then save the figure which is also square in size, 
> i.e. like 600x600 pixels and not 800x600. How can I acheive this?
> 
>  to get the square axes, I used 
> 
> ax.set_aspect(1./ax.get_data_ratio())

I think what you want here may be something like

fig = figure(figsize=(6, 6), dpi=100)
ax = fig.add_subplot(1,1,1)
[... plotting commands]
ax.set_aspect('equal', adjustable='box')
fig.savefig('mysquarefig.png', dpi=100)

Eric


> 
>  
> 
> but I have no idea how to save the fig also in a square format.
> 
> thanks in advance,
> 
> 
> 
> 
> 
> ------------------------------------------------------------------------
> 
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by:
> SourcForge Community
> SourceForge wants to tell your story.
> http://p.sf.net/sfu/sf-spreadtheword
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users


------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to