Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #10981 > unrolled thread

Re: Plotting: how does one reverse the time axis tick mark values?

Started by"djmpark" <djmpark@comcast.net>
First post2012-07-19 07:55 +0000
Last post2012-07-19 07:55 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.soft-sys.math.mathematica

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Plotting: how does one reverse the time axis tick mark values? "djmpark" <djmpark@comcast.net> - 2012-07-19 07:55 +0000

#10981 — Re: Plotting: how does one reverse the time axis tick mark values?

From"djmpark" <djmpark@comcast.net>
Date2012-07-19 07:55 +0000
SubjectRe: Plotting: how does one reverse the time axis tick mark values?
Message-ID<ju8ehr$9b4$1@smc.vnet.net>
The Presentations Application has a CustomTicks function where the first
argument IS a 'TickMarkLabelFunction'. Also CustomTicks draws both the major
and minor ticks and allows you to control both the style of the ticks and
the style of the labels.

<< Presentations` 

There are two methods. The first method rescales the displayed tick values
of 4 to 0 to go to the underlying plot values of 2 to 6. Then we specify
ticks going from 5 to 0 in steps of -1 with 5 minor tick intervals. I used 5
to 0 so the minor ticks would show below the first plot value.

xticks = CustomTicks[Rescale[#, {4, 0}, {2, 6}] &, {5, 0, -1, 5}];
ListPlot[Transpose[{Range[6], Range[6]}],
 Ticks -> {xticks, Automatic}]

The second method specifies in terms of the underlying plot values, but uses
a number function to rescale the actual display tick values.

xticks = CustomTicks[Identity, {1, 6, 1, 5},
   CTNumberFunction -> (Rescale[#, {4, 0}, {2, 6}] &)];
ListPlot[Transpose[{Range[6], Range[6]}],
 Ticks -> {xticks, Automatic}]


David Park
djmpark@comcast.net 
http://home.comcast.net/~djmpark/index.html 


From: James Stein [mailto:james@stein.org] 


I thought this would be simple, but I am stumped: I wish to display values
(on the y axis) for specific times (on the x-axis).
Conventionally, time on charts progresses from left to right, and this is my
desire. However, I want the ticks along the time axis to be measured in what
one might call "countDown units" or "reverse units", for example "Myr before
Present" or "Seconds before Midnight" or "Centuries B.C.".

As a simple example, consider the result of
     ListPlot [ Transpose [ { Range [ 6 ] , Range [ 6 ] } ] ] which displays
the values 2, 3, 4, 5, 6 along the x axis.
My problem is how to construct this same chart, except with values 4, 3, 2,
1, 0  replacing 2, 3, 4, 5, 6.
The various ways I tried to do this also mirror-reflect the plotted
y-values.
I looked for an option called something akin to 'TickMarkLabelFunction', but
couldn't find one.

[toc] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web