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