On 2015/04/08 7:04 AM, Jody Klymak wrote:
> Following up on this, I’d like to complain about set_aspect()…
>
> If I do:
>
> import matplotlib.pyplot as plt
> fig, axes = plt.subplots(nrows=2,sharex=True)
> axes[0].set_ylim(0,1.)
> axes[0].set_aspect(1.)
> plt.show()
>
> the x-axis goes from 0. to 1., but axes[0]’s y-axis goes from 0.32 to
> 0.67.  Swapping the order of the y_lim call doesn’t help.  This is very
> un-intuitive, as I’d expect set_ylim() to set what data I see no matter
> what else is happening w/ the plot.
>
> I see that
> axes[0].set_aspect(1.,adjustable=‘box-forced’)
> will give the desired behaviour, but I really think it should be the
> default, not adjustable=‘datalim'.  I had no idea set_aspect() had this
> parameter until today, and have had several cursing matches with
> set_aspect as it kept changing my explicitly set data limits. set_ylim()
> should set the y limits.
>
> Just my opinion.  Maybe there is a reason for the default, but I really
> think the data view should be prioritized over the shape of the axis.

Jody,

I'm the guilty party for most of how set_aspect works.  I developed it a 
long time ago. Yes, there was a reason--still is, I'm 99% sure--but I 
don't remember everything, and don't want to take the time now to 
reconstruct the whole rationale.  When I was developing the behavior, I 
was paying a lot of attention to what happens under various scenarios of 
resizing and reshaping the window, and turning options on and off. 
There are some basic conflicts that arise when shared axes are combined 
with fixed aspect ratios, autoscaling, and gui-driven reshaping. 
Sometimes 'box-forced' does what people want, maybe more often than not; 
but I'm pretty sure it can lead to trouble, which is the reason it is 
not the default.

Eric

>
> Thanks,   Jody
>


------------------------------------------------------------------------------
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to