RE: I hate using Legend
- To: mathgroup at smc.vnet.net
- Subject: [mg29173] RE: [mg29147] I hate using Legend
- From: "David Park" <djmp at earthlink.net>
- Date: Fri, 1 Jun 2001 04:15:35 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
Brett, 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. Needs["Graphics`Legend`"] Needs["Graphics`Colors`"] 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 earthlink.net http://home.earthlink.net/~djmp/ > From: Brett Patterson [mailto:bap at roe.ac.uk] To: mathgroup at smc.vnet.net > > 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 > > > >