MathGroup Archive 2003

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

Search the Archive

Frameticks labels as numbers

  • To: mathgroup at smc.vnet.net
  • Subject: [mg41754] Frameticks labels as numbers
  • From: howard.fink at nyu.edu (Howard Fink)
  • Date: Wed, 4 Jun 2003 08:34:38 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

A client requested ticks at the top of a plot to be in a numeric ratio
to ticks at the bottom and vertically aligned.  Here's what I came up
with.

You can label any tick with a text label.  In upperticks, I created a
list with the same values as lowerticks, calculated the ratio, then
applied ToString to convert to text.

lowerticks = Table[z, {z, 0, 2Pi, 1}];
upperticks = Apply [ToString, Table[{z, z/2031.67}, {z, 0, 2Pi, 1}],
{2, 2}];

Plot[Sin[x], {x, 0, 2Pi}, Frame -> True , 
  FrameTicks -> {lowerticks, None, upperticks, None}]


Maybe it's trivial, (and apologies to the BIG BRAINS) but it involved
a jaunt through the help browser stopping at Map, MapAt, Inner, Outer,
Distribute, Thread, MapThread, and Apply, until I stopped and
carefully counted to get the levelspec right.

Howard Fink


  • Prev by Date: Re: Mathematica shows wrong numbers
  • Next by Date: Re: Coverting 3D graphics to 2D raster WITHIN Mathematica
  • Previous by thread: Re: Mathematica shows wrong numbers
  • Next by thread: Re: Frameticks labels as numbers