As per the matplotlib documentation, x and/or y may be 2D arrays, and in this case the columns are treated as different datasets. When I follow the example in the matplotlib page it works fine:
>>> x = [1, 2, 3]
>>> y = np.array([[1, 2], [3, 4], [5, 6]])
>>> plot(x, y)
However, when I try with larger, float64 arrays, it plots a weird figure. This is what I got
from scipy.stats import chi2
x = np.linspace(0,5,1000)
chi2_2, chi2_5 = chi2.pdf(x,2), chi2.pdf(x,5)
y = np.array((chi2_2,chi2_5)).reshape(1000,2)
fig, ax = plt.subplots()
ax.plot(x,y)
and produces this plot:
if I plot them separately, it comes out fine:
fig, ax = plt.subplots()
ax.plot(x,chi2_2,'b')
ax.plot(x,chi2_5,'r')
I can't figure out what is the difference between the example and my case other then using 2D arrays with Float64 instead of Int64. Any help is appreciated.