Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to change plot size in matplotlib

# 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()
Source by pythonguides.com #
 
PREVIOUS NEXT
Tagged: #change #plot #size #matplotlib
ADD COMMENT
Topic
Name
3+3 =