Yes Eric this is what I wanted and Many thanks for your help.

 My question now extends a little. Due to this .. my yaxis label is
truncated in the png. How can I make sure that my figure is square and also
contains everything. Is it possilbe?

Thanks again,

On Mon, Jan 26, 2009 at 8:42 AM, Eric Firing <efir...@hawaii.edu> wrote:

> 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