MathGroup Archive 2001

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

Search the Archive

RE: I hate using Legend

  • To: mathgroup at
  • Subject: [mg29173] RE: [mg29147] I hate using Legend
  • From: "David Park" <djmp at>
  • Date: Fri, 1 Jun 2001 04:15:35 -0400 (EDT)
  • Sender: owner-wri-mathgroup at


Legend is one of those Mathematica facilities that seems to offer more than
it easily delivers. Nevertheless, in usually can be made to produce
reasonable results. I suspect that in your case you have to use the
LegendTextSpace option to tell Legend that the text space is going to take
up considerably more space than the key box. Also you have to adjust
LegendSize to make the box much wider than it is high. Here is an example
with a long label.


Plot[{Sin[x], Cos[x]}, {x, 0, 2*Pi}, PlotStyle -> {Blue, Red},
   PlotLegend -> {"Sin Curve in Blue", "Cos Curve in Red"},
   LegendTextSpace -> 3, LegendSize -> {1.5, 0.2}];

Also, there are alternatives to identifying curves, which are often more
natural than a legend. Sometimes you can use Text to label curves directly
on the plot. You can also use color coded frame or plot labels. You can even
put the plot in a Rectangle within a larger region and then add all the
explanatory keys and text that you want.

David Park
djmp at

> From: Brett Patterson [mailto:bap at]
To: mathgroup at
> I am very frustrated by the Legend package.
> I have tried using it on and off for several years now,
> and I am always dissatisfied with its output.
> The main difficulty I have is with the size of the legend box
> being too small for the key label I want to use.
> It works fine for single (or a few) letter labels,
> but seems to screw up for a label of more than about 10 characters.
> The box clips the longer labels.
> I've tried using LabelTextSpacing, etc but it then
> opens a can of worms trying to balance all the spacings
> to get a decent label.
> Does anyone else have these problems with Legend?
> Are there any easy answers?
> Regards,
> Brett Patterson

  • Prev by Date: RE: Re: OOP in Mathematica
  • Next by Date: Re: OOP in Mathematica
  • Previous by thread: Re: I hate using Legend
  • Next by thread: RE: I hate using Legend