set_data and autoscale_view matplotlib
This video explains
set_data and autoscale_view matplotlib
--
Become part of the top 3% of the developers by applying to Toptal
https://topt.al/25cXVn
--
Music by Eric Matyas
https://www.soundimage.org
Track title: Hypnotic Orient Looping
--
Chapters
00:00 Question
01:38 Accepted answer (Score 50)
02:14 Thank you
--
Full question
https://stackoverflow.com/questions/7187...
Question links:
[this]: http://www.mailinglistarchive.com/html/m...
[this]: https://stackoverflow.com/questions/3214...
Accepted answer links:
[matplotlib docs for autoscale_view]: http://matplotlib.sourceforge.net/api/ax...
--
Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...
--
Tags
#python #matplotlib
#avk47
set_data and autoscale_view matplotlib
--
Become part of the top 3% of the developers by applying to Toptal
https://topt.al/25cXVn
--
Music by Eric Matyas
https://www.soundimage.org
Track title: Hypnotic Orient Looping
--
Chapters
00:00 Question
01:38 Accepted answer (Score 50)
02:14 Thank you
--
Full question
https://stackoverflow.com/questions/7187...
Question links:
[this]: http://www.mailinglistarchive.com/html/m...
[this]: https://stackoverflow.com/questions/3214...
Accepted answer links:
[matplotlib docs for autoscale_view]: http://matplotlib.sourceforge.net/api/ax...
--
Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...
--
Tags
#python #matplotlib
#avk47
ACCEPTED ANSWER
Score 53
From the matplotlib docs for autoscale_view:
The data limits are not updated automatically when artist data are changed after the artist has been added to an Axes instance. In that case, use matplotlib.axes.Axes.relim() prior to calling autoscale_view.
So, you'll need to add two lines before your plt.draw() call after the set_data call:
axes.relim()
axes.autoscale_view(True,True,True)