I have a numpy array Y of shape (1360, 1024) which contains aggregated 1360 data set that each are of length 1024. I have another array of shape (1024,) called X.
This is what Y[0:5] looks like (as example):
array([[13.72059917, 16.27633476, 18.49536324, ..., 0.81599081,
0.99834043, 0.92653233],
[13.42022991, 15.06573963, 17.45792198, ..., 0.85495144,
0.75660354, 1.02977574],
[13.6416111 , 16.03499603, 17.46924019, ..., 0.85070604,
0.94057351, 0.87749392],
[14.69120216, 16.85452461, 17.6070137 , ..., 0.86291492,
0.99953759, 0.81989962],
[13.57082653, 16.15143394, 17.55677032, ..., 0.93469822,
0.96676576, 1.09142995]])
Now I want to plot all the 1360 Y data sets on top of each other. For all of them the x-axis is the same, i.e. X.
I know I can do this to plot multiple things:
pyplot.plot(X,Y[0],X,Y[1],X,Y[2])
but that looks like brute force. Also this could be solved with a loop, but not very elegant.
I tried a bit with list comprehension to make the X,Y[0]... automatically but failed.
Ideally I want a one-line solution and no loop.
pyplot.plot(X, Y.T)(or without the transpose,pyplot.plot(X, Y), depending on how you stored your data)