0

Similar to this (unanswered) question, how can I resize an existing figure and axis? For example, I would like to do the following:

fig, ax = plt.subplots(figsize=(3,3))
# (3,3) figure
ax.plot(range(10))
fig.savefig("33.pdf")

# (6,3) figure
fig.figsize=(6,3)
ax.plot(range(10))
fig.savefig("63.pdf")

but the command fig.figsize=(6,3) doesn't work.

jjjjjj
  • 1,152
  • 1
  • 14
  • 30
  • Please see: https://matplotlib.org/stable/api/figure_api.html#matplotlib.figure.Figure.set_size_inches – Jody Klymak Aug 11 '22 at 21:27
  • @JodyKlymak: Thanks, the `set_size_inches` call in the [answer](https://stackoverflow.com/a/4306340/6272122) you linked to is what I was looking for! – jjjjjj Aug 12 '22 at 02:05

0 Answers0