I am aware of this question, which discusses how to "gloabally" change the fontsize in matplotlib. My use case is slightly different: I want the output to be sth like
Array 1 (number of elements: 100)
Array 1 (number of elements: 250)
So an MWE would be:
import numpy as np
from matplotlib import pyplot as plt
a = np.random.rand(100)
b = np.random.rand(250)
plt.hist(a, bins=100, label='Array 1 (number of elements: {})'.format(a.shape[0]))
plt.hist(b, bins=100, label='Array 2 (number of elements: {})'.format(b.shape[0]))
plt.legend()
plt.show()
plt.close()
How can the fontsize be changed only "locally" in matplotlib?
EDIT: Sorry if the output looks confusing, but the part in small fontsize should not be upper or lower, it should just be smaller.
