Question about ylims

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Question about ylims

John Doucette
I am trying to make a 2 x 2 figure with covid-19 graphs 

Upper left = cases  Upper right = cumulative cases
Lower left = deaths Lower right = cumulative deaths

I have been having trouble with ylims. It appears that if I set a ylim it is applied to all four frames. 

I have been searching duckduckgo  for hour including the matplotlib gallery and every set of multiple frame plots has the same ylim on every frame. 

I need different ylims for each individual frame. Is this even possible? 

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

Re: Question about ylims

tcaswell
John,

Please subscribe to the mailing list (https://mail.python.org/mailman/listinfo/matplotlib-users) so you can post un-moderated.

Can you include a minimal example of what you are doing which is not working?  What you want is definitely possible:

fig, ax_arr = plt.subplots(2, 2)
ax_arr[0, 0].set_ylim(0, 5)
ax_arr[1, 0].set_ylim(-5, 0)
# and so-on


Tom

On Fri, Jun 26, 2020 at 6:59 PM John Doucette <[hidden email]> wrote:
I am trying to make a 2 x 2 figure with covid-19 graphs 

Upper left = cases  Upper right = cumulative cases
Lower left = deaths Lower right = cumulative deaths

I have been having trouble with ylims. It appears that if I set a ylim it is applied to all four frames. 

I have been searching duckduckgo  for hour including the matplotlib gallery and every set of multiple frame plots has the same ylim on every frame. 

I need different ylims for each individual frame. Is this even possible? 
_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users


--
Thomas Caswell
[hidden email]

_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users