Re: Plotting x and y arrays
- To: mathgroup at smc.vnet.net
- Subject: [mg82657] Re: Plotting x and y arrays
- From: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>
- Date: Sat, 27 Oct 2007 06:05:35 -0400 (EDT)
- Organization: The Open University, Milton Keynes, UK
- References: <ffsc78$mp4$1@smc.vnet.net>
John Lee wrote:
> I have a table of x values and a separate table of corresponding y values. Is there a way to plot these values directly without using MapThread and without creating a new table to store the x and y values?
>
> Thanks,
> John
>
Say xvals ans yvals are two tables that contain the x and y values,
respectively. Then you can use
ListPlot[Transpose[{xvals, yvals}]]
to plot the data. For instance,
xvals = RandomReal[{0, 5}, {20}]
yvals = Sin@xvals
ListPlot[Transpose[{xvals, yvals}], Filling -> Axis]
HTH,
--
Jean-Marc