Re: ListPlot
- To: mathgroup at smc.vnet.net
- Subject: [mg107853] Re: ListPlot
- From: Barrie Stokes <Barrie.Stokes at newcastle.edu.au>
- Date: Mon, 1 Mar 2010 04:42:03 -0500 (EST)
Hi John
How about this?
y1 = RandomReal[ NormalDistribution[ 0, 1 ] ]
y2 = RandomReal[ NormalDistribution[ 0, 1 ] ]
y3 = RandomReal[ NormalDistribution[ 0, 1 ] ]
y4 = RandomReal[ NormalDistribution[ 1, 1 ] ]
y5 = RandomReal[ NormalDistribution[ 1, 1 ] ]
y6 = RandomReal[ NormalDistribution[ 1, 1 ] ]
ListPlot[{{{1, y1}, {1, y2}, {1, y3}}, {{2, y4}, {2, y5}, {2,
y6}}}, PlotStyle -> {PointSize[ 0.02 ]}]
sample1 = Table[ {1, RandomReal[ NormalDistribution[ 0, 1 ] ]} , {20}]
sample2 = Table[ {2, RandomReal[ NormalDistribution[ 1, 1 ] ]} , {20}]
ListPlot[{sample1, sample2}, PlotStyle -> {PointSize[ 0.02 ]}]
Cheers
Barrie
>>> On 28/02/2010 at 8:52 pm, in message <201002280952.EAA25673 at smc.vnet.net>, John
<jwa0 at lehigh.edu> wrote:
> Mathematica 6, XP windows
>
> Help says ListPlot plots lists of points, but my attempts to plot the
> following two lists failed:
>
> ListPlot[{{{1,y1},{1,y2},{1,y3}},{{2,y4},{2,y5},{2,y6}}}]
>
> The second entries in each pair are simulated values of random
> variables having the normal distribution, with specified parameters.
>
> The plot would have instructional value because the students could
> compare different samples side by side.
>
> I would appreciate hearing from anyone who knows how to do this.
>
> John