MathGroup Archive 2000

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

Search the Archive

Re: Using ShowLegend

  • To: mathgroup at
  • Subject: [mg24963] Re: Using ShowLegend
  • From: "Borut L." <JustMyName at>
  • Date: Mon, 28 Aug 2000 08:27:21 -0400 (EDT)
  • References: <8o4rim$>
  • Sender: owner-wri-mathgroup at


PlotLegend will do alright!
I think, that you forgot to evaluate functions in Table. So, to plot sin x,
sin 2x and sin 3x on the same graph with legend you need to do:

In[1]:= <<Graphics`Legend`


    Evaluate[Table[Sin[i x], {i, 3}]], {x, 0, 2\[Pi]},
    PlotStyle -> {Hue[0], GrayLevel[0.6],Hue[0.3]},
    PlotLegend -> {"sin x", "sin 2x", "sin 3x"}

Again, function should be evaluated first, so Legend command can pick them
up to continue. Legend also uses PlotStyle to draw the legend right.

ShowLegend on the other hand could be good alternative. It's used in other
2D graphics than Plot.

bye, Borut

Karthik <kspk at> wrote in message news:8o4rim$f2f at
> I have created a plot with 3 curves. I want to associate a legend with
> these curves - the legend must contain a full line and two broken lines
> with varying lengths of the dashes.
> I cannot use PlotLegend because the curves are created inside a Table
> command. ShowLegend seems to be the way to go, but I can't make
> it go thru. Can someone post a simple example of ShowLegend containing
> multiple curves with a corresponding legend?
> Thanks in advance.
> Karthik
> Sent via
> Before you buy.

  • Prev by Date: Re: opening files
  • Next by Date: Please recommend a better test strategy??
  • Previous by thread: Re: Using ShowLegend
  • Next by thread: Re: Using ShowLegend