MathGroup Archive 2003

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

Search the Archive

RE: newbie graph question

  • To: mathgroup at smc.vnet.net
  • Subject: [mg39798] RE: [mg39765] newbie graph question
  • From: "David Park" <djmp at earthlink.net>
  • Date: Fri, 7 Mar 2003 03:40:31 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

Stewart,

Yes. I obtained the following from the excellent book "Mathematica
Navigator" by Heikki Ruskeepaa. Here is an example.

xticks = MapThread[{#1, #2} &, {Range[12], {"Jan", "Feb", "Mar", "Apr",
"May",
           "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"}}];

plot1 = Plot[1 + x, {x, 0, 12},
      Ticks -> {xticks, Automatic},
      ImageSize -> 300];

At this size the month labels run together. We could enlarge the plot size,
but we could also rotate the labels.

Show[FullGraphics[plot1] /.
      Text[a_String, b_, c_] -> Text[a, b, {0, 1}, {0, 1}],
    PlotRange -> All];

FullGraphics extracts all the primitive graphics for the plot, including the
axes, ticks and labels. The horizontal tick values were translated to Text
statements by Mathematica. In the Text statement we can control the
placement, alignment and direction of the text. The last {0, 1} in the new
Text statement specifies a vertical direction. If we had String labels for
the vertical axis, we might have to do more work.

To see what the FullGraphics looks like and better understand how the above
method worked, evaluate..

First[FullGraphics[plot1]]

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



From: Stewart Mandell [mailto:stewart at rentec.com]
To: mathgroup at smc.vnet.net

Is it possible to have horizontal tick axes labels "really" rotated 90
degrees.
i.e. "Hello" rotated 90 degrees counter-clockwise about its right-center
anchor
point.

            thank you





  • Prev by Date: Re: Re: visualizing Map, Thread, Apply
  • Next by Date: Re: Emergent Help: NSolve Problems!
  • Previous by thread: Re: newbie graph question
  • Next by thread: Tentative conclusion: Mathematica cannot output plain text