MathGroup Archive 2000

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

Search the Archive

Re: Legend Package

  • To: mathgroup at
  • Subject: [mg22256] Re: [mg22227] Legend Package
  • From: Tim Stiles <tastiles at>
  • Date: Sat, 19 Feb 2000 01:34:02 -0500 (EST)
  • Organization: University of Wisconsin
  • References: <>
  • Sender: owner-wri-mathgroup at

David Park wrote:

> MathGroup,
> Does anyone know how the legends are specified in the ShowLegend statement? The
> documentation show an example for the second type of legend, but not for the first
> type of legend. I cannot understand what to put in for box_1 in their statement
> format. Nothing I try is reflected on the plot. Does anyone have an example of this
> form of the statement.
> I am even more interested in using the Legend and ShadowBox primitives. I know how to
> use the ShadowBox primitive and can put text and lines in it "by hand". But I do not
> know how to use the Legend primitive, partly because I do not know what to put in for
> the box_i statements, and also because I don't know how to combine it with the
> ShadowBox primitive. Does anyone have any examples of this?
> Thanks.
> David Park
> djmp at

Wolfram's Technical support web pages actually have two good web pages dealing with
ShowLegend. The first is a mini-tutorial in using ShowLegend, it is available at

the second offers some more examples of ShowLegend and goes into detail about using the
Legend command.
Its URL is

The basic idea of ShowLegend is that you pass it two arguments. The first is a graphics
object like Show or LogPlot, the second is a list of parameters that get passed to the
Legend command. Legend takes one argument, a list of identifiers to use for each key in
the legend. Each element of this list consists of two parts. The first is either a
Graphics command with appropriate directives (RGBColor, AbsoluteDashing, etc.) and
primitives (Line, Point, etc.) or simply a directive with the implied directive being
Rectangle, producing a box of certain color or shade. The second part of each element of
the list is the label to be used for each key. After this list of lists of graphics to
be used to make the key, you can add options that get passed to Legend, such as
LegendSize and LegendPosition. A good example is shown on the first of the referenced

You can use the Legend command to create ShadowBoxes with graphics and text in them. The
format of arguments of Legend would be the same as outlined above, to display it, you
would use Show[Graphics[Legend[...]]]. Several examples of using Legend this way are
displayed in the second of the above-referenced web pages. Legend by itself makes a
ShadowBox, so you would not need to combine Legend and ShadowBox.

Hope this helps.

Tim Stiles
tastiles at

  • Prev by Date: Re: export graphics
  • Next by Date: Re: Mathematica formulae as Word metafiles
  • Previous by thread: Legend Package
  • Next by thread: Re: Legend Package