Jeff Whitaker wrote:
> Michael Droettboom wrote:
>> It may be now be tricky to call apply_aspect correctly.  With the 
>> recent auto-layout changes, it's required to be called after the text 
>> layout has been done, but before it has been drawn.  What is your use 
>> case for calling it outside of that?  Do you need to set and then use 
>> the aspect-adjusted axes position?  Since apply_aspect is always 
>> called from within draw() anyway, for most uses, calling outside of 
>> that would be redundant, and I was considering making it a private 
>> method.  If you don't call it from your code, is anything different?
>>
>> Cheers,
>> Mi
> 
> Mike:  The only side effect of not calling apply_aspect that I can see 
> involves the use of ax.get_position().  The axes position that you get 
> is not what will ultimately be drawn on the figure unless you call 
> apply_aspect before get_position.  This comes into play when setting the 
> position of colorbar axes, since you want them to line up with the axes 
> of the image.

That makes sense.  I'll do what you suggest for now -- but 
unfortunately, apply_aspect is no longer "good enough" to determine the 
ultimate position of the axes, since they can also be adjusted based on 
the surrounding text now.

Alas, this auto-layout thing gets more complicated.  I'll have to figure 
out something more robust (possibly combining the 
text-overlapping-prevention and the aspect ratio into a single call 
somehow).

Cheers,
Mike

>> Jeff Whitaker wrote:
>>>
>>> Mike: I see that ax.apply_aspect now has a 'position' argument.  To 
>>> maintain backward compatibility, may I suggest that you make it a 
>>> kwarg, with default value None, and then add
>>>
>>> if position is None:
>>>    position = self._originalPosition
>>>
>>> at the top of apply_aspect?
>>>
>>> -Jeff
>>>
>>
> 
> 

-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA

-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel

Reply via email to