Re: Flip tick and axeslabel position
- To: mathgroup at smc.vnet.net
- Subject: [mg9536] Re: Flip tick and axeslabel position
- From: tburton at cts.com (Tom Burton)
- Date: Thu, 13 Nov 1997 01:40:02 -0500
- Organization: Brahea Consulting
- Sender: owner-wri-mathgroup at wolfram.com
On 8 Nov 1997 23:45:54 -0500, in comp.soft-sys.math.mathematica you
wrote:
>I'm a new user of mathematica, it may be that my question is answered
>in the online help, but I didn't find it.
>
>By default ticks are on the positive and axeslabels on the negative side
>of the axes.
>
>Can I flip them to the other side?
>
I assume in what follows that you want to flip the ticks but not the
labels.
Among alphabetical list of applications options returned by
Options[Plot]
is Ticks. On-line reference help for Ticks explains how to specify that
ticks go below the axis and then VERY helpfully recommends the
=46ullOptions command to obtain the complete setting of Ticks.
Here is example of how to use this function. Let p be a plot that is
the way you want it, except that ticks need to be flipped:
p=ListPlot[Table[x,{x,1,2,.5}]]
Inspection of the yield of FullOptions[p,Ticks] suggests that the
following simple rule will flip the ticks:
flippedTicks=FullOptions[p,Ticks]/.{plen_Real,0.}:>{0.,plen};
It certainly works in my simple example. Perhaps a more elaborate rule
may be needed on occasion. At any rate, the modified plot pf has
flipped ticks:
pf=Show[p,Ticks->flippedTicks]
Tom Burton