Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python - How to adjust the size of matplotlib legend box

import matplotlib.pyplot as plt
import numpy as np

x = np.linspace(0, 10, 100)

fig, ax = plt.subplots()
for i in range(1, 6):
    ax.plot(x, i*x + x, label='$y={i}x + {i}$'.format(i=i))
ax.legend(loc='upper left')
plt.show()
Source by pythonhowto.org #
 
PREVIOUS NEXT
Tagged: #python #How #adjust #size #matplotlib #legend #box
ADD COMMENT
Topic
Name
5+1 =