I want to customize the number of rows in each column of the matplotlib legend text.
The code is:
import matplotlib.pyplot as plt
import numpy as np
for i in range(10):
plt.plot(np.linspace(0, 5, 5), np.random.randint(0, 10, 5), label=str(i))
plt.legend(ncol = 3, loc = 1)
plt.show()
What I get: the numbers of rows in each column are 4, 3, 3

What I want: the numbers of rows in each column are 4, 4, 2
I've tried adding plt.plot([], [], label='') before plt.show(), but it doesn't help

