Skip to main content
Rollback to Revision 3 - after additional discussion, it's been decided that this preserves the spirit of the original answer while clarifying it (comment edited Mar 1, 2023 at 14:29)
Source Link
Ryan M
  • 20.7k
  • 35
  • 76
  • 86

Try commenting outAdjust the fig = ...figsize= lineparameter in matplotlib.pyplot.figure, which is similar to this answer, but uses the standard plt import alias, and doesn't directly import figure from the pyplot namespace.

import numpy as np
import matplotlib.pyplot as plt

N = 50
np.random.seed(2022)  # creates a repetitive sample data
x = np.random.rand(N)
y = np.random.rand(N)
area = np.pi * (15 * np.random.rand(N))**2

fig = plt.figure(figsize=(1810, 1810))
plt.scatter(x, y, s=area, alpha=0.5)
plt.show()

Without fig = plt.figure(figsize=(10, 10))

enter image description here

With fig = plt.figure(figsize=(10, 10))

enter image description here

Try commenting out the fig = ... line

import numpy as np
import matplotlib.pyplot as plt

N = 50
x = np.random.rand(N)
y = np.random.rand(N)
area = np.pi * (15 * np.random.rand(N))**2

fig = plt.figure(figsize=(18, 18))
plt.scatter(x, y, s=area, alpha=0.5)
plt.show()

Adjust the figsize= parameter in matplotlib.pyplot.figure, which is similar to this answer, but uses the standard plt import alias, and doesn't directly import figure from the pyplot namespace.

import numpy as np
import matplotlib.pyplot as plt

N = 50
np.random.seed(2022)  # creates a repetitive sample data
x = np.random.rand(N)
y = np.random.rand(N)
area = np.pi * (15 * np.random.rand(N))**2

fig = plt.figure(figsize=(10, 10))
plt.scatter(x, y, s=area, alpha=0.5)
plt.show()

Without fig = plt.figure(figsize=(10, 10))

enter image description here

With fig = plt.figure(figsize=(10, 10))

enter image description here

Rollback to Revision 7
Source Link

Adjust the figsize= parameter in matplotlib.pyplot.figure, which is similar to this answer, but uses the standard plt import alias, and doesn't directly import figure fromTry commenting out the pyplotfig = ... namespace.line

import numpy as np
import matplotlib.pyplot as plt

N = 50
np.random.seed(2022)  # creates a repetitive sample data
x = np.random.rand(N)
y = np.random.rand(N)
area = np.pi * (15 * np.random.rand(N))**2

fig = plt.figure(figsize=(1018, 1018))
plt.scatter(x, y, s=area, alpha=0.5)
plt.show()

Without fig = plt.figure(figsize=(10, 10))

enter image description here

With fig = plt.figure(figsize=(10, 10))

enter image description here

Adjust the figsize= parameter in matplotlib.pyplot.figure, which is similar to this answer, but uses the standard plt import alias, and doesn't directly import figure from the pyplot namespace.

import numpy as np
import matplotlib.pyplot as plt

N = 50
np.random.seed(2022)  # creates a repetitive sample data
x = np.random.rand(N)
y = np.random.rand(N)
area = np.pi * (15 * np.random.rand(N))**2

fig = plt.figure(figsize=(10, 10))
plt.scatter(x, y, s=area, alpha=0.5)
plt.show()

Without fig = plt.figure(figsize=(10, 10))

enter image description here

With fig = plt.figure(figsize=(10, 10))

enter image description here

Try commenting out the fig = ... line

import numpy as np
import matplotlib.pyplot as plt

N = 50
x = np.random.rand(N)
y = np.random.rand(N)
area = np.pi * (15 * np.random.rand(N))**2

fig = plt.figure(figsize=(18, 18))
plt.scatter(x, y, s=area, alpha=0.5)
plt.show()
Rollback to Revision 6
Source Link
Trenton McKinney
  • 63.4k
  • 41
  • 172
  • 215

Try commenting outAdjust the fig = ...figsize= lineparameter in matplotlib.pyplot.figure, which is similar to this answer, but uses the standard plt import alias, and doesn't directly import figure from the pyplot namespace.

import numpy as np
import matplotlib.pyplot as plt

N = 50
np.random.seed(2022)  # creates a repetitive sample data
x = np.random.rand(N)
y = np.random.rand(N)
area = np.pi * (15 * np.random.rand(N))**2

fig = plt.figure(figsize=(1810, 1810))
plt.scatter(x, y, s=area, alpha=0.5)
plt.show()

Without fig = plt.figure(figsize=(10, 10))

enter image description here

With fig = plt.figure(figsize=(10, 10))

enter image description here

Try commenting out the fig = ... line

import numpy as np
import matplotlib.pyplot as plt

N = 50
x = np.random.rand(N)
y = np.random.rand(N)
area = np.pi * (15 * np.random.rand(N))**2

fig = plt.figure(figsize=(18, 18))
plt.scatter(x, y, s=area, alpha=0.5)
plt.show()

Adjust the figsize= parameter in matplotlib.pyplot.figure, which is similar to this answer, but uses the standard plt import alias, and doesn't directly import figure from the pyplot namespace.

import numpy as np
import matplotlib.pyplot as plt

N = 50
np.random.seed(2022)  # creates a repetitive sample data
x = np.random.rand(N)
y = np.random.rand(N)
area = np.pi * (15 * np.random.rand(N))**2

fig = plt.figure(figsize=(10, 10))
plt.scatter(x, y, s=area, alpha=0.5)
plt.show()

Without fig = plt.figure(figsize=(10, 10))

enter image description here

With fig = plt.figure(figsize=(10, 10))

enter image description here

Rollback to Revision 5
Source Link
Loading
Rollback to Revision 3
Source Link
Trenton McKinney
  • 63.4k
  • 41
  • 172
  • 215
Loading
Removed notebook command.
Source Link
Loading
Rollback to Revision 1
Source Link
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
%matplotlib inline isn't relevant to the question. Added links and plots for clarity
Source Link
Trenton McKinney
  • 63.4k
  • 41
  • 172
  • 215
Loading
Source Link
Renaud
  • 16.6k
  • 7
  • 83
  • 81
Loading