autoscale y axis in different [x1,x2] range

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
jlx
Reply | Threaded
Open this post in threaded view
|

autoscale y axis in different [x1,x2] range

jlx
hey everyone, I meet a problem about autoscale.

I change the x axis range so that I can see the details of the curve, but y
axis range is always the same, it does not change automatically to zoom in.

I tried autoscale on and set_autoscale_view, but do not work, could you help
me about that?

the following are curves at whole x range and [x1,x2] range:

<http://matplotlib.1069221.n5.nabble.com/file/t5114/whole.png>
<http://matplotlib.1069221.n5.nabble.com/file/t5114/10-20.png>

So how to make the black, red and blue curves fit the subplot window
automatically?


Thank you!




--
Sent from: http://matplotlib.1069221.n5.nabble.com/matplotlib-users-f3.html
_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users
Joe
Reply | Threaded
Open this post in threaded view
|

Re: autoscale y axis in different [x1,x2] range

Joe
Did you use a shared x axis for the plots? (sharex?
see also
https://matplotlib.org/examples/pylab_examples/shared_axis_demo.html

Am 30.11.2017 10:55 schrieb jlx:

> hey everyone, I meet a problem about autoscale.
>
> I change the x axis range so that I can see the details of the curve,
> but y
> axis range is always the same, it does not change automatically to zoom
> in.
>
> I tried autoscale on and set_autoscale_view, but do not work, could you
> help
> me about that?
>
> the following are curves at whole x range and [x1,x2] range:
>
> <http://matplotlib.1069221.n5.nabble.com/file/t5114/whole.png>
> <http://matplotlib.1069221.n5.nabble.com/file/t5114/10-20.png>
>
> So how to make the black, red and blue curves fit the subplot window
> automatically?
>
>
> Thank you!
>
>
>
>
> --
> Sent from:
> http://matplotlib.1069221.n5.nabble.com/matplotlib-users-f3.html
> _______________________________________________
> Matplotlib-users mailing list
> [hidden email]
> https://mail.python.org/mailman/listinfo/matplotlib-users
_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users
Reply | Threaded
Open this post in threaded view
|

Re: autoscale y axis in different [x1,x2] range

Eric Firing
In reply to this post by jlx
On 2017/11/29 11:55 PM, jlx wrote:

> hey everyone, I meet a problem about autoscale.
>
> I change the x axis range so that I can see the details of the curve, but y
> axis range is always the same, it does not change automatically to zoom in.
>
> I tried autoscale on and set_autoscale_view, but do not work, could you help
> me about that?
>
> the following are curves at whole x range and [x1,x2] range:
>
> <http://matplotlib.1069221.n5.nabble.com/file/t5114/whole.png>
> <http://matplotlib.1069221.n5.nabble.com/file/t5114/10-20.png>
>
> So how to make the black, red and blue curves fit the subplot window
> automatically?

You will need to write a function to calculate the appropriate y limits
based on your input data and the x limits, and then connect it to the
'xlim_changed' event.  Something like this is illustrated here:
http://matplotlib.org/gallery/event_handling/resample.html#sphx-glr-gallery-event-handling-resample-py

Eric
_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users
jlx
Reply | Threaded
Open this post in threaded view
|

Re: autoscale y axis in different [x1,x2] range

jlx
thank you, I have solved this problem, sth slimier to yours



--
Sent from: http://matplotlib.1069221.n5.nabble.com/matplotlib-users-f3.html
_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users
jlx
Reply | Threaded
Open this post in threaded view
|

Re: autoscale y axis in different [x1,x2] range

jlx
In reply to this post by Joe
thank you, I indeed shared the x axis. Now I have addressed this problem,
thanks all the same



--
Sent from: http://matplotlib.1069221.n5.nabble.com/matplotlib-users-f3.html
_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users