 
 
 
 
 
 
Re: how to plot 2 functions in different colors?
- To: mathgroup at smc.vnet.net
- Subject: [mg33595] Re: [mg33583] how to plot 2 functions in different colors?
- From: BobHanlon at aol.com
- Date: Wed, 3 Apr 2002 01:13:17 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
In a message dated 4/2/02 3:47:27 AM, gzhu1 at uiuc.edu writes:
>I can plot two functions in one diagram with plot[{fa[x],fb[x]},{x,1,100}],
>but they are in same color and hard to seperated.  Is there any way to
>make
>them in different colors?
>
Use the PlotStyle option
Needs["Graphics`Colors`"];
Plot[{Sin[x], Cos[x]}, {x,-3Pi/2,2Pi},
 
    PlotStyle -> {Red,
 
        {AbsoluteDashing[{5,5}],Blue}},
    Epilog->{
        Text["Sin", {Pi, .5}],
        Text["Cos", {Pi/2, -.5}]},
    ImageSize->350];
Needs["Graphics`Legend`"];
Plot[{Sin[x], Cos[x]}, {x,-3Pi/2,2Pi},
 
    PlotStyle -> {Red,
 
        {AbsoluteDashing[{5,5}],Blue}},
 
    PlotLegend->{"Sin[x]", "Cos[x]"},
 
    ImageSize->350];
Bob Hanlon
Chantilly, VA  USA

