# How can I make a scatter plot from a matrix with many y-axis values for each x-axis value?

Consider matrix

A =
{{0, 2.54343, 3.566, 4.2323, 2.3434},
{0.1, 6.432, 4.6465, 5.656, 1.34},
{0.2, 0.3423, 1.6342, 3.323, 2.04}};


The x-axis values are 0, 0.1, 0.2. There are four y-axis values for each x-axis value.

How do I plot this?

Naive use of

ListPlot[A]


fails.

Transpose the list A , remove its first list and use the option DataRange:

ListPlot[Rest[Transpose@A], DataRange -> {0, .2}, Frame -> True, Axes -> False,
PlotRangePadding -> Scaled[.1], BaseStyle -> PointSize[Large]] Alternatively, create new input list with explicit x values for each point:

d1 = Thread[{A[[All, 1]], #}]& /@ Rest[Transpose@A];;
ListPlot[d1, Frame -> True, Axes->False,
PlotRangePadding -> Scaled[.1], BaseStyle -> PointSize[Large]]


same picture

You can also use TemporalData using {0, .1, .2} as the common time stamps:

d2 =  TemporalData[Rest/@ A, {A[[All,1]]}];;
ListPlot[d2, Frame -> True, Axes -> False,
BaseStyle -> PointSize[Large],  PlotRangePadding -> Scaled[.1]]


same picture

• I'm guessing that the OP has A[[All,1]] as the x-values with A[[All,{2,3,4,5}]] as the y-values. – JimB Jun 16 '19 at 19:09
• @JimB, thank you. Fixed the errors now. – kglr Jun 16 '19 at 19:25