Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Re: legend for multiples curves on 2-D graph with mathematica
Replies: 0

 BobHanlon@aol.com Posts: 906 Registered: 12/7/04
Re: legend for multiples curves on 2-D graph with mathematica
Posted: Sep 26, 1996 10:10 PM

Xavier,

Look in the Guide to Standard Packages:

Needs["Graphics`Legend`"];

var = x; nbrCycles = 4; k1 = 3; k2 = 1; k3 = 1; k4 = 0.1;
legend1 = "Sin[" <> ToString[k1] <> ToString[var] <>
"] * \n Cos[" <> ToString[k2] <> ToString[var] <> "]";
legend2 = "Cos[" <> ToString[k3] <> ToString[var] <>
"] * \n Exp[-" <> ToString[k4] <> ToString[var] <> "]";
Plot[{Sin[k1 x] Cos[k2 x], Cos[k3 x] Exp[-k4 x]},
{x, 0, nbrCycles Pi},
AxesLabel->{ToString[var],
"f[" <> ToString[var] <> "]"},
Ticks->{Table[{N[k Pi], ToString[k] <> "x"},
{k, 0, nbrCycles}], Automatic},
PlotStyle->{GrayLevel[0], Dashing[{0.03}]},
PlotLegend->{legend1, legend2},
LegendBorder->RGBColor[0, 0, 1]];

Bob Hanlon
bobhanlon@aol.com

---------------------
Forwarded message:
From: xavier@agen.ufl.edu (Xavier Foussereau)
To: BobHanlon@aol.com
Date: 96-09-24 12:34:59 EDT

Hello,

I am a graduate student at the University of Florida. For my research, I am
using Mathematica. I need to create 2-D graph with multiples curves which
legends include text and variable. Do you know how to to it? Thank in