Skip to main content
Rollback to Revision 11
Source Link

matplotlib.figure.Figure.get_size_inches and matplotlib.figure.Figure.set_size_inches can be used to adjust the size of the plot figure This works well for me:

from matplotlib import pyplot as plt
 
x = [1, 2]
yF = [1, 1]

# without resizing
plt.plotgcf(x, y)

enter image description here

x = [1, 2]
ySize = [1, 1]

pltF.plotget_size_inches(x, y)
 
# get the existing figure
F = plt.gcfset_size_inches()
SizeSize[0]*2, =Size[1]*2, F.get_size_inches(forward=True)

  # Set forward to True to resize window along with plot in figure.
F.set_size_inches(Size[0]*2, Size[1]*2, forward=True) 

plt.show() # Or plt.imshow(z_array) if using an animation, where z_array is a matrix or NumPy array

enter image description here This forum post might also help: Resizing figure windows

matplotlib.figure.Figure.get_size_inches and matplotlib.figure.Figure.set_size_inches can be used to adjust the size of the plot figure

from matplotlib import pyplot as plt
 
x = [1, 2]
y = [1, 1]

# without resizing
plt.plot(x, y)

enter image description here

x = [1, 2]
y = [1, 1]

plt.plot(x, y)
 
# get the existing figure
F = plt.gcf()
Size = F.get_size_inches()

 # Set forward to True to resize window along with plot in figure.
F.set_size_inches(Size[0]*2, Size[1]*2, forward=True) 

plt.show() # Or plt.imshow(z_array) if using an animation, where z_array is a matrix or NumPy array

enter image description here

This works well for me:

from matplotlib import pyplot as plt

F = plt.gcf()
Size = F.get_size_inches()
F.set_size_inches(Size[0]*2, Size[1]*2, forward=True) # Set forward to True to resize window along with plot in figure.
plt.show() # Or plt.imshow(z_array) if using an animation, where z_array is a matrix or NumPy array

This forum post might also help: Resizing figure windows

Rollback to Revision 10
Source Link
Trenton McKinney
  • 63.4k
  • 41
  • 172
  • 215

This works well for me:matplotlib.figure.Figure.get_size_inches and matplotlib.figure.Figure.set_size_inches can be used to adjust the size of the plot figure

from matplotlib import pyplot as plt

Fx = [1, 2]
y = [1, 1]

# without resizing
plt.gcfplot(x, y)
Size

enter image description here

x = F[1, 2]
y = [1, 1]

plt.get_size_inchesplot(x, y) 

# get the existing figure
F = plt.set_size_inchesgcf(Size[0]*2,)
Size Size[1]*2,= forward=TrueF.get_size_inches()  

# Set forward to True to resize window along with plot in figure.
F.set_size_inches(Size[0]*2, Size[1]*2, forward=True) 

plt.show() # Or plt.imshow(z_array) if using an animation, where z_array is a matrix or NumPy array

This forum post might also help: Resizing figure windowsenter image description here

This works well for me:

from matplotlib import pyplot as plt

F = plt.gcf()
Size = F.get_size_inches()
F.set_size_inches(Size[0]*2, Size[1]*2, forward=True) # Set forward to True to resize window along with plot in figure.
plt.show() # Or plt.imshow(z_array) if using an animation, where z_array is a matrix or NumPy array

This forum post might also help: Resizing figure windows

matplotlib.figure.Figure.get_size_inches and matplotlib.figure.Figure.set_size_inches can be used to adjust the size of the plot figure

from matplotlib import pyplot as plt

x = [1, 2]
y = [1, 1]

# without resizing
plt.plot(x, y)

enter image description here

x = [1, 2]
y = [1, 1]

plt.plot(x, y) 

# get the existing figure
F = plt.gcf()
Size = F.get_size_inches() 

# Set forward to True to resize window along with plot in figure.
F.set_size_inches(Size[0]*2, Size[1]*2, forward=True) 

plt.show() # Or plt.imshow(z_array) if using an animation, where z_array is a matrix or NumPy array

enter image description here

Rollback to Revision 9
Source Link

matplotlib.figure.Figure.get_size_inches and matplotlib.figure.Figure.set_size_inches can be used to adjust the size of the plot figure This works well for me:

from matplotlib import pyplot as plt
 
x = [1, 2]
yF = [1, 1]

# without resizing
plt.plotgcf(x, y)

enter image description here

x = [1, 2]
ySize = [1, 1]

pltF.plotget_size_inches(x, y)
 
# get the existing figure
F = plt.gcfset_size_inches()
SizeSize[0]*2, =Size[1]*2, F.get_size_inches(forward=True)

  # Set forward to True to resize window along with plot in figure.
F.set_size_inches(Size[0]*2, Size[1]*2, forward=True) 

plt.show() # Or plt.imshow(z_array) if using an animation, where z_array is a matrix or NumPy array

enter image description here This forum post might also help: Resizing figure windows

matplotlib.figure.Figure.get_size_inches and matplotlib.figure.Figure.set_size_inches can be used to adjust the size of the plot figure

from matplotlib import pyplot as plt
 
x = [1, 2]
y = [1, 1]

# without resizing
plt.plot(x, y)

enter image description here

x = [1, 2]
y = [1, 1]

plt.plot(x, y)
 
# get the existing figure
F = plt.gcf()
Size = F.get_size_inches()

 # Set forward to True to resize window along with plot in figure.
F.set_size_inches(Size[0]*2, Size[1]*2, forward=True) 

plt.show() # Or plt.imshow(z_array) if using an animation, where z_array is a matrix or NumPy array

enter image description here

This works well for me:

from matplotlib import pyplot as plt

F = plt.gcf()
Size = F.get_size_inches()
F.set_size_inches(Size[0]*2, Size[1]*2, forward=True) # Set forward to True to resize window along with plot in figure.
plt.show() # Or plt.imshow(z_array) if using an animation, where z_array is a matrix or NumPy array

This forum post might also help: Resizing figure windows

Rollback to Revision 8
Source Link
Trenton McKinney
  • 63.4k
  • 41
  • 172
  • 215
Loading
Rollback to Revision 7
Source Link
Loading
Rollback to Revision 6
Source Link
Trenton McKinney
  • 63.4k
  • 41
  • 172
  • 215
Loading
Rollback to Revision 4
Source Link
Loading
deleted 20 characters in body
Source Link
Trenton McKinney
  • 63.4k
  • 41
  • 172
  • 215
Loading
Updated the answer for clarity. This is an attempt to clean up the question, answers, and remove duplicates.
Source Link
Trenton McKinney
  • 63.4k
  • 41
  • 172
  • 215
Loading
Active reading [<https://en.wikipedia.org/wiki/NumPy>]. Dressed the naked link.
Source Link
Peter Mortensen
  • 31.1k
  • 22
  • 111
  • 134
Loading
fixed trivial error
Source Link
Loading
deleted 3 characters in body
Source Link
William Miller
  • 10.4k
  • 4
  • 31
  • 50
Loading
Source Link
Blairg23
  • 12.2k
  • 7
  • 78
  • 76
Loading