# How to plot multivariate tabular data

Suppose I have tabular data usual for numeric packages:

T = Table[{x, Sin[x], Cos[x]}, {x, 0, 1, 0.1}];
T // TableForm


Now I want to plot T. I want to plot it discrete as two point plots against single x. How can I do that?

I can't catch how to use some of ListPlots here.

• ListLinePlot[Transpose[Rest /@ T], DataRange -> T[[ {1, -1}, 1]]] ?
– Kuba
Oct 17, 2014 at 10:05
• Or ListPlot[..., Filling -> Bottom] if you want the DiscretePlot style
– Öskå
Oct 17, 2014 at 10:07
• @Kuba isb't there some simpler function ready made? Oct 17, 2014 at 11:00
• @SuzanCioc One can not expect that there will be sparate function for each data structure you can imagine :)
– Kuba
Oct 17, 2014 at 12:50
• This structure was imagined not by me, but by numerous creators of numeric packages, like Excel, Matlab, Statistica etc. Oct 17, 2014 at 14:07

ListPlot[{T[[All, {1, 2}]], T[[All, {1, 3}]]}]


or

ListPlot[T[[All, {1, #}]] & /@ {2, 3}]


Here are some ways:

pd = Map[Function[x, Thread[{#1, x}]], {##2}] & @@ Transpose[tab];
ListPlot[pd]


or

ListPlot[Transpose /@ ({{#1, #2}, {#1, #3}} & @@ Transpose[tab])]


As comments note you can also use:

DiscretePlot[{Sin[x], Cos[x]}, {x, 0, 1, 0.1}]