MathGroup Archive 2000

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

Search the Archive

Re: Legend Package

  • To: mathgroup at smc.vnet.net
  • Subject: [mg22301] Re: [mg22227] Legend Package
  • From: "F. Mittermayr" <mitterma at linz.vai.co.at>
  • Date: Thu, 24 Feb 2000 03:01:17 -0500 (EST)
  • References: <200002180735.CAA08334@smc.vnet.net> <88lcac$bur@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Using the Legend Package has one big disadvantage because it "destroys the
coordinates" in combination with using the Text[...] option.

p=Plot[{Sin[x]}, {x,-3,3}, DisplayFunction->Identity];
Show[{p,Graphics[Text["Sin", {1,1}]]}, DisplayFunction->$DisplayFunction];

plots the curve and puts the text "Sin" to the coordinates (1,1) but

Needs["Graphics`Legend`"]
p=Plot[{Sin[x]}, {x,-3,3}, DisplayFunction->Identity,
PlotLegend->{"Sin(x)"}];
Show[{p,Graphics[Text["Sin", {1,1}]]}, DisplayFunction->$DisplayFunction];

plots the curve and puts the text anywhere else.


so long  F. Mittermayr


Tim Stiles <tastiles at students.wisc.edu> wrote in message
news:88lcac$bur at smc.vnet.net...
> 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 earthlink.net
> > http://home.earthlink.net/~djmp/
>
> 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
>
> http://support.wolfram.com/Graphics/Axes/ShowLegend.html
>
> the second offers some more examples of ShowLegend and goes into detail
about using the
> Legend command.
> Its URL is
>
> http://support.wolfram.com/Graphics/ShowLegendExamples.html
>
> 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
> pages
>
> 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 students.wisc.edu
>
>




  • Prev by Date: Re: Linux: how compatible with add-ons ?
  • Next by Date: Re: Notional NotebookOpen Nonplus?
  • Previous by thread: Re: Legend Package
  • Next by thread: Re: Legend Package