[Matplotlib-users] Question about ylims

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?


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



Thomas Caswell