matplotlib-users@lists.sourceforge.net

Hi everybody,

I have a problem with my application using Tkinter.

To simplify, here follows a small program showing the encountered problem:

···

################
from pylab import *

a = arange( 10 )

plot( 0.5*a, cos(a) )

gca().set_autoscale_on(False)

plot( a, cos(a), 'r' )
gca().set_autoscale_on(True)
show()
################

At this time, the problem is that by clicking on the "house" (first button in
the pylab toolbar), it is impossible to get the two curves completely,
whereas the "pan/zoom mode" (the cross button) shows that the red curve has
been drawn completely.

Is there a function to obtain a "true" autoscale, i.e. that looks at all data
on the plot, and computes the best view?

Thanks a lot

Julien

Why are you turning autoscaling off and on? When you turn it off, the autoscale mechanism effectively "ignores" any plots until you turn it back on. If you remove

gca().set_autoscale_on(False)

all seems to work fine.

Is your question that you want to autoscale to a plot after creating it?

Mike

paratribulations@...185... wrote:

···

Hi everybody,

I have a problem with my application using Tkinter.

To simplify, here follows a small program showing the encountered problem:

################
from pylab import *

a = arange( 10 )

plot( 0.5*a, cos(a) )

gca().set_autoscale_on(False)

plot( a, cos(a), 'r' )
gca().set_autoscale_on(True)
show()
################

At this time, the problem is that by clicking on the "house" (first button in
the pylab toolbar), it is impossible to get the two curves completely,
whereas the "pan/zoom mode" (the cross button) shows that the red curve has
been drawn completely.

Is there a function to obtain a "true" autoscale, i.e. that looks at all data
on the plot, and computes the best view?

Thanks a lot

Julien

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
  
--
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA