xxxxxxxxxx
import matplotlib.pyplot as plt
# Define the figure size
fig, ax = plt.subplots(figsize=(8, 6))
# Plot some data
x = [1, 2, 3, 4, 5]
y = [3, 6, 2, 7, 1]
ax.plot(x, y)
# Show the plot
plt.show()
xxxxxxxxxx
import matplotlib.pyplot as plt
plt.rcParams["figure.figsize"] = (20,3)
xxxxxxxxxx
# Import Library
import matplotlib.pyplot as plt
# Increase size of plot in jupyter
plt.rcParams["figure.figsize"] = (8,5.5)
# Define Data
x = [2, 4, 6, 8]
y = [5, 10, 15, 20]
# Plot
plt.plot(x, y, '-.')
# Display
plt.show()
xxxxxxxxxx
in matplotlib library just add plt.rcParams["figure.figsize"]= (x,y) in inches to get size of graph
xxxxxxxxxx
subplot(1,1,1)
plot(x, y, 'r--')
subplot(1,2,2)
plot(y, x, 'g*-');