autoscale y axis in different [x1,x2] range

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

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&gt;
<http://matplotlib.1069221.n5.nabble.com/file/t5114/10-20.png&gt;

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
Matplotlib-users at python.org
Matplotlib-users Info Page

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

···

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&gt;
<http://matplotlib.1069221.n5.nabble.com/file/t5114/10-20.png&gt;

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

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

···

--
Sent from: http://matplotlib.1069221.n5.nabble.com/matplotlib-users-f3.html

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