Skip to main content
Updated for Matplotlib 2.2.0
Source Link
River
  • 9.2k
  • 15
  • 57
  • 69

You can simply use (from matplotlib.figure.Figurefrom matplotlib.figure.Figure):

fig.set_size_inches(width,height)

As of Matplotlib 2.0.0 it will even automatically update, changes to your canvas will be visible immediately, as the forward keyword now defaults to True. (For earlier versions you need to specify forward=True explicitlydefaults to True.)

If you want to just change the width or heightchange the width or height instead of both, you can use

fig.set_figwidth(val)

fig.set_figwidth(val) or fig.set_figheight(val)

fig.set_figheight(val)

These will also immediately update your canvas, but only in Matplotlib 2.2.0 and newer.

For Older Versions

Unfortunately youYou need to specify forward=True explicitly in order to automatically propagatelive-update your canvas in versions older than what is specified above. Note that the changes as it still defaults to Falseset_figwidth for these functions, though this is being fixed.and (Theseset_figheight functions don’t support the forward parameter in versions older than Matplotlib 1.5.0).

You can simply use (from matplotlib.figure.Figure):

fig.set_size_inches(width,height)

As of Matplotlib 2.0.0 it will even automatically update your canvas as the forward keyword now defaults to True. (For earlier versions you need to specify forward=True explicitly.)

If you want to just change the width or height instead of both, you can use

fig.set_figwidth(val)

or

fig.set_figheight(val)

Unfortunately you need to specify forward=True to automatically propagate the changes as it still defaults to False for these functions, though this is being fixed. (These functions don’t support forward in versions older than Matplotlib 1.5.0)

You can simply use (from matplotlib.figure.Figure):

fig.set_size_inches(width,height)

As of Matplotlib 2.0.0, changes to your canvas will be visible immediately, as the forward keyword defaults to True.

If you want to just change the width or height instead of both, you can use

fig.set_figwidth(val) or fig.set_figheight(val)

These will also immediately update your canvas, but only in Matplotlib 2.2.0 and newer.

For Older Versions

You need to specify forward=True explicitly in order to live-update your canvas in versions older than what is specified above. Note that the set_figwidth and set_figheight functions don’t support the forward parameter in versions older than Matplotlib 1.5.0.

added 32 characters in body
Source Link
River
  • 9.2k
  • 15
  • 57
  • 69

You can simply use (You can simply use:from matplotlib.figure.Figure):

fig.set_size_inches(width,height)

As of Matplotlib 2.0.0 it will even automatically update your canvas as the forward keyword now defaults to True. (For earlier versions you need to specify forward=True explicitly.)

If you want to just change the width or height instead of both, you can use

fig.set_figwidth(val)

or

fig.set_figheight(val)

Unfortunately you need to specify forward=True to automatically propagate the changes as it still defaults to False for these functions, though this is being fixed. (These functions don’t support forward in versions older than Matplotlib 1.5.0)

You can simply use:

fig.set_size_inches(width,height)

As of Matplotlib 2.0.0 it will even automatically update your canvas as the forward keyword now defaults to True. (For earlier versions you need to specify forward=True explicitly.)

If you want to just change the width or height instead of both, you can use

fig.set_figwidth(val)

or

fig.set_figheight(val)

Unfortunately you need to specify forward=True to automatically propagate the changes as it still defaults to False for these functions, though this is being fixed. (These functions don’t support forward in versions older than Matplotlib 1.5.0)

You can simply use (from matplotlib.figure.Figure):

fig.set_size_inches(width,height)

As of Matplotlib 2.0.0 it will even automatically update your canvas as the forward keyword now defaults to True. (For earlier versions you need to specify forward=True explicitly.)

If you want to just change the width or height instead of both, you can use

fig.set_figwidth(val)

or

fig.set_figheight(val)

Unfortunately you need to specify forward=True to automatically propagate the changes as it still defaults to False for these functions, though this is being fixed. (These functions don’t support forward in versions older than Matplotlib 1.5.0)

added 12 characters in body; added 10 characters in body
Source Link
River
  • 9.2k
  • 15
  • 57
  • 69

You can simply use:

fig.set_size_inches(width,height)

As of Matplotlib 2.0.0 it will even automatically update your canvas as the forward keyword now defaults to True. (For earlier versions you need to specify forward=True explicitly.)

If you want to just change the width or height instead of both, you can use

fig.set_figwidth(val)

or

fig.set_figheight(val)

Unfortunately you need to specify forward=True to automatically propagate the changes as it still defaults to False for these functions, though this is being fixed. (These functions don’t support forward in versions older than Matplotlib 1.5.0)

You can simply use:

set_size_inches(width,height)

As of Matplotlib 2.0.0 it will even automatically update your canvas as the forward keyword now defaults to True. (For earlier versions you need to specify forward=True explicitly.)

If you want to just change the width or height instead of both, you can use

set_figwidth

or

set_figheight

Unfortunately you need to specify forward=True to automatically propagate the changes as it still defaults to False for these functions, though this is being fixed. (These functions don’t support forward in versions older than Matplotlib 1.5.0)

You can simply use:

fig.set_size_inches(width,height)

As of Matplotlib 2.0.0 it will even automatically update your canvas as the forward keyword now defaults to True. (For earlier versions you need to specify forward=True explicitly.)

If you want to just change the width or height instead of both, you can use

fig.set_figwidth(val)

or

fig.set_figheight(val)

Unfortunately you need to specify forward=True to automatically propagate the changes as it still defaults to False for these functions, though this is being fixed. (These functions don’t support forward in versions older than Matplotlib 1.5.0)

added 83 characters in body
Source Link
River
  • 9.2k
  • 15
  • 57
  • 69
Loading
added 1 character in body; edited body; added 76 characters in body; added 17 characters in body
Source Link
River
  • 9.2k
  • 15
  • 57
  • 69
Loading
Source Link
River
  • 9.2k
  • 15
  • 57
  • 69
Loading