xxxxxxxxxx
from matplotlib.pyplot import figure
figure(figsize=(8, 6), dpi=80)
xxxxxxxxxx
import matplotlib.pyplot as plt
# Create a figure and set the size
fig = plt.figure(figsize=(8, 6))
# Optionally, plot something on the figure
plt.plot([1, 2, 3, 4], [1, 4, 2, 3], 'ro')
# Display the figure
plt.show()