Skip to main content
deleted 76 characters in body
Source Link

If you've already got the figure created, you can use figure.set_size_inches to adjust the figure size:

fig = matplotlib.pyplot.gcf()
fig.set_size_inches(18.5, 10.5)
fig.savefig('test2png.png', dpi=100)

To propagate the size change to an existing GUI window, add forward=True:

fig.set_size_inches(18.5, 10.5, forward=True)

Additionally as Erik Shilts mentioned in the commentsErik Shilts mentioned in the comments you can also use figure.set_dpi to "[s]et the resolution of the figure in dots-per-inch"

fig.set_dpi(100)

If you've already got the figure created, you can use figure.set_size_inches to adjust the figure size:

fig = matplotlib.pyplot.gcf()
fig.set_size_inches(18.5, 10.5)
fig.savefig('test2png.png', dpi=100)

To propagate the size change to an existing GUI window, add forward=True:

fig.set_size_inches(18.5, 10.5, forward=True)

Additionally as Erik Shilts mentioned in the comments you can also use figure.set_dpi to "[s]et the resolution of the figure in dots-per-inch"

fig.set_dpi(100)

If you've already got the figure created, you can use figure.set_size_inches to adjust the figure size:

fig = matplotlib.pyplot.gcf()
fig.set_size_inches(18.5, 10.5)
fig.savefig('test2png.png', dpi=100)

To propagate the size change to an existing GUI window, add forward=True:

fig.set_size_inches(18.5, 10.5, forward=True)

Additionally as Erik Shilts mentioned in the comments you can also use figure.set_dpi to "[s]et the resolution of the figure in dots-per-inch"

fig.set_dpi(100)
Rollback to Revision 7
Source Link

If you've already got the figure created, you can use figure.set_size_inches to adjust the figure size:

fig = matplotlib.pyplot.gcf()
fig.set_size_inches(18.5, 10.5)
fig.savefig('test2png.png', dpi=100)

To propagate the size change to an existing GUI window, add forward=True:

fig.set_size_inches(18.5, 10.5, forward=True)

Additionally as Erik Shilts mentioned in the comments you can also use figure.set_dpi can be used to "[s]et the resolution of the figure in dots-per-inch"

fig.set_dpi(100)

If you've already got the figure created, you can use figure.set_size_inches to adjust the figure size:

fig = matplotlib.pyplot.gcf()
fig.set_size_inches(18.5, 10.5)
fig.savefig('test2png.png', dpi=100)

To propagate the size change to an existing GUI window, add forward=True:

fig.set_size_inches(18.5, 10.5, forward=True)

figure.set_dpi can be used to "[s]et the resolution of the figure in dots-per-inch"

fig.set_dpi(100)

If you've already got the figure created, you can use figure.set_size_inches to adjust the figure size:

fig = matplotlib.pyplot.gcf()
fig.set_size_inches(18.5, 10.5)
fig.savefig('test2png.png', dpi=100)

To propagate the size change to an existing GUI window, add forward=True:

fig.set_size_inches(18.5, 10.5, forward=True)

Additionally as Erik Shilts mentioned in the comments you can also use figure.set_dpi to "[s]et the resolution of the figure in dots-per-inch"

fig.set_dpi(100)
Changed sentence structure. Also my previous edit didn't add any details about rcParams, that part of the comment was accidentally copied from another edit.
Source Link
Trenton McKinney
  • 63.4k
  • 41
  • 172
  • 215

If you've already got the figure created, you can use figure.set_size_inches to adjust the figure size:

fig = matplotlib.pyplot.gcf()
fig.set_size_inches(18.5, 10.5)
fig.savefig('test2png.png', dpi=100)

To propagate the size change to an existing GUI window, add forward=True:

fig.set_size_inches(18.5, 10.5, forward=True)

You can also use figure.set_dpi can be used to "[s]et the resolution of the figure in dots-per-inch"

fig.set_dpi(100)

If you've already got the figure created, you can use figure.set_size_inches to adjust the figure size:

fig = matplotlib.pyplot.gcf()
fig.set_size_inches(18.5, 10.5)
fig.savefig('test2png.png', dpi=100)

To propagate the size change to an existing GUI window, add forward=True:

fig.set_size_inches(18.5, 10.5, forward=True)

You can also use figure.set_dpi to "[s]et the resolution of the figure in dots-per-inch"

fig.set_dpi(100)

If you've already got the figure created, you can use figure.set_size_inches to adjust the figure size:

fig = matplotlib.pyplot.gcf()
fig.set_size_inches(18.5, 10.5)
fig.savefig('test2png.png', dpi=100)

To propagate the size change to an existing GUI window, add forward=True:

fig.set_size_inches(18.5, 10.5, forward=True)

figure.set_dpi can be used to "[s]et the resolution of the figure in dots-per-inch"

fig.set_dpi(100)
The referenced comment has been removed, so no point in linking. Added additional details and references for rcParams
Source Link
Trenton McKinney
  • 63.4k
  • 41
  • 172
  • 215
Loading
Updated to move useful information from comments to answer body; Added links to documentation
Source Link
Henry Ecker
  • 35.9k
  • 19
  • 49
  • 67
Loading
Fixed misleading changes of last edit.
Source Link
john-hen
  • 5k
  • 2
  • 30
  • 48
Loading
Active reading [<https://en.wikipedia.org/wiki/Graphical_user_interface>].
Source Link
Peter Mortensen
  • 31.1k
  • 22
  • 111
  • 134
Loading
added 132 characters in body
Source Link
tacaswell
  • 88.3k
  • 23
  • 222
  • 203
Loading
edited body
Source Link
leventov
  • 15.5k
  • 11
  • 76
  • 104
Loading
spelled out call to pyplot
Source Link
Pete
  • 17.2k
  • 10
  • 42
  • 55
Loading
Source Link
Pete
  • 17.2k
  • 10
  • 42
  • 55
Loading