MathGroup Archive 2004

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

Search the Archive

RE: labeling curves on a plot

  • To: mathgroup at smc.vnet.net
  • Subject: [mg47921] RE: [mg47889] labeling curves on a plot
  • From: "David Park" <djmp at earthlink.net>
  • Date: Fri, 30 Apr 2004 19:27:00 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

Andrew,

Use Epilog to include Text statements for labeling each curve.

Needs["Graphics`Colors`"]

Plot[Evaluate[Table[BesselJ[n, x], {n, 0, 5}]], {x, 0, 10},
   PlotRange -> All, AxesLabel -> TraditionalForm /@ {x, BesselJ[n, x]},
   PlotStyle -> {Black, Red, Yellow, Green, Blue, Violet},
   Epilog ->
    {Text[Subscript[J, 0], {0.851126, 0.932177}],
     Text[Subscript[J, 1], {1.96546, 0.645342}],
     Text[Subscript[J, 2], {3.23409, 0.565359}],
     Text[Subscript[J, 3], {4.31477, 0.496039}],
     Text[Subscript[J, 4], {5.44244, 0.464046}],
     Text[Subscript[J, 5], {6.82854, 0.437385}]},
    Background -> Linen,
    ImageSize -> 500];

The locations for the Text statements were obtained by clicking off the
points from the initial plot without the labels. Select the plot, hold down
Ctrl and click the point. Copy and paste into the Text statement.

With DrawGraphics from my web site I might do the plot in the following
manner

Needs["DrawGraphics`DrawingMaster`"]

Draw2D[
    {MapThread[
        {#2, Draw[BesselJ[#1, x], {x, 0, 10}],
         Black, Text[Subscript[J, #1], #3]} &,
     {Range[0, 5], {Black, Red, Yellow, Green, Blue, Violet},
     {{0.851126, 0.932177}, {1.96546, 0.645342}, {3.23409, 0.565359},
      {4.31477, 0.496039}, {5.44244, 0.464046}, {6.82854, 0.437385}}}]},
    Frame -> True,
    Background -> Linen,
    ImageSize -> 500];

David Park
djmp at earthlink.net
http://home.earthlink.net/~djmp/


From: Andrew Collier [mailto:abcollier at phreaker.net]
To: mathgroup at smc.vnet.net

hello,

could someone please give me some pointers on how to label individual
curves on a plot. i am trying to achieve something like the plot on
http://mathworld.wolfram.com/BesselFunctionoftheFirstKind.html where
each of the curves is labelled "J0(x)", "J1(x)" etc.

was mathematica use to the produce the plot on the above page? i would
hope so... and if so, then how were the labels formatted so nicely?

thanks for any help!

best regards,
andrew collier.




  • Prev by Date: Re: bug in IntegerPart ?
  • Next by Date: Re: export plot data
  • Previous by thread: Re: labeling curves on a plot
  • Next by thread: export plot data