python - Plotting rows corresponding to a given y-value separately -


suppose have table of data-

no. 200 400 600 800  1    13 14 17 18   2    16 18 20 21  3    20 15 18 19 

and on...

where each column represents y-value given x-value. first line x-value , first column number of each dataset.

how can read in , plot each row seperately?

for idea of how results table have quoted above see following images. have plotted each plot individually.

http://postimg.org/image/yw46zw7er/92d01c08/

http://postimg.org/image/c1kf2nqwp/29a8b1c8/

matplotlib plots 2d arrays plotting each column, here need transpose data. assuming data in text file called data.csv.

import numpy np import matplotlib.pyplot plt data = np.loadtxt('data.csv') x = [200, 400, 600, 800] plt.plot(x, data.t) plt.legend((1,2,3)) plt.show() 

the requested plot


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

CSS3 Transition to highlight new elements created in JQuery -