Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a CSV file with $9$ columns. I want to plot them in the following way. Column $1$ will be along the $X$-axis. Any point $(x_i, y_i)$ of $i$-th curve in the plot will have the $x$ value from the corresponding row of column $1$ and the $y$ value from the $x$-th row of the $(i-1)$-th column. So, there will be $8$ curves in the plot. The file could be downloaded from this link. The code is:

data = Import["iso-pair-data.csv", "CSV"]; ListPlot[{data[[All, 2]],
data[[All, 3]], data[[All, 4]]}, Joined -> True, PlotMarkers -> Automatic]

I am not getting the plot as expected. Any help?

share|improve this question
I think this is what you're trying to do: ListPlot[Rest@Transpose@data, Joined -> True, PlotRange -> Full] – C. E. Jul 16 '14 at 20:40
I do not get it. Lets say i=2, ok? So the first column is the x-values, fine. Now the y-values you are saying come from the rows of the (i-1) column? but this is 1 in this case? But that is supposed to be the x-values for all the other columns. Are you simply trying to plot columns 2-9 against the first column? – Nasser Jul 16 '14 at 20:40
@Nasser It should be i+1... if you use all the information in the question I don't think there can be any doubt. – C. E. Jul 16 '14 at 20:43
up vote 4 down vote accepted

Does this work for you?

vals = Table[Transpose[{data[[All, 1]], data[[All, i]]}], {i, 2, 
ListLinePlot[vals, Joined -> True, 
 PlotRange -> {Automatic, {0, Max[data[[All, 2 ;;]]]}}, 
 ImageSize -> Large]

enter image description here

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.