MathGroup Archive 2000

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: newby plotting question

  • To: mathgroup at smc.vnet.net
  • Subject: [mg22773] Re: newby plotting question
  • From: Murray Eisenberg <murray at math.umass.edu>
  • Date: Fri, 24 Mar 2000 03:28:38 -0500 (EST)
  • Organization: Mathematics & Statistics, Univ. of Mass./Amherst
  • References: <8b9orp$9dj@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

One solution is to use a the function MultipleListPlot in one of the
Standard AddOn packages:

  << Graphics`MultipleListPlot`

  MultipleListPlot[mean, mean + Sqrt[var], mean - Sqrt[var], 
    PlotStyle -> {RGBColor[0, 0, 0], RGBColor[0, 1, 0], RGBColor[1, 0,
0]}, 
    PlotJoined -> True];

This makes the broken lines joining the points in each of the three
lists the color you want.  The points themselves stay black but have
different symbols (rectangle, plus sign, box); there are options to
change the symbols.

"F. Schwieterman" wrote:
> 
> I have three lists I want to plot on the same graph, in different colors.
> My code went as follows:
> (mean and var are lists of numbers, of the same length)
> 
> p1 = ListPlot[ mean, PlotRange->All];
> p2 = ListPlot[ mean + Sqrt[var],
>             DefaultColor -> RGBColor[0,1,0], PlotRange->All];
> p3 = ListPlot[ mean - Sqrt[var],
>             DefaultColor -> RGBColor[1,0,0], PlotRange->All]];
> Show[p1,p2,p3];
> 
> But this unfortunately draws p1, p2, and p3 on separate plots before drawing
> all three on a single plot, and they were all black on the last plot anyhow.
> 
> So I was clever, and came up with the following:
> 
> Show[
>           ListPlot[ mean, PlotRange->All],
>           ListPlot[ mean + Sqrt[var],
>             DefaultColor -> RGBColor[0,1,0], PlotRange->All],
>           ListPlot[ mean - Sqrt[var],
>             DefaultColor -> RGBColor[1,0,0], PlotRange->All]]
> 
> Which produces the same result.  ugh.  Any advice?
> 
> best karma to the best answers. :)

-- 
Murray Eisenberg                     murray at math.umass.edu
Mathematics & Statistics Dept.       phone 413 549-1020 (H)
Univ. of Massachusetts                     413 545-2859 (W)
Amherst, MA 01003-4515


  • Prev by Date: Re: FindMinimum
  • Next by Date: Re: Hydrogen atom modelling for P-Chem
  • Previous by thread: Re: newby plotting question
  • Next by thread: Re: newby plotting question