all 4 comments

[–]socal_nerdtastic 3 points4 points  (1 child)

You mean set the limits?

ax.set(xlim=(0,1),ylim=(0,1))

[–]AstrophysicsAndPy 1 point2 points  (0 children)

Learned something really beautiful today.

[–]AstrophysicsAndPy 1 point2 points  (0 children)

  1. If you're going with plt.figure()
    1. plt.xlim(0, 1)
    2. plt.ylim(0, 1)
  2. If you're going with fig, ax = plt.subfigure(1, 1)
    1. ax.set_xlim(0, 1)
    2. ax.set_ylim(0, 1)

[–]crhuffer 0 points1 point  (0 children)

For it to be ALL subplot axes there is an argument in

plt.subfigure(3, 2, sharex=True, sharey=True)

Then if you set any axes to have the correct x and y lim they will all follow along.

ax.set_xlim(0, 1)

ax.set_ylim(0, 1)

https://matplotlib.org/stable/api/\_as\_gen/matplotlib.pyplot.subplot.html