Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Topic: Plotting: how does one reverse the time axis tick
Replies: 4   Last Post: Jul 19, 2012 3:56 AM

 Messages: [ Previous | Next ]
 James Stein Posts: 12 Registered: 8/12/10
Re: Plotting: how does one reverse the time axis tick mark values?
Posted: Jul 19, 2012 3:56 AM

Thank you for your elegant solution, Bob.

Somehow, 'AbsoluteOptions' has never come to my attention before; even
'Options' help page), I doubt I could have grasped its purpose or
utility. Perhaps your solution would be a good second example in the
'AbsoluteOptions' help page.

I came close (but no cigar): I used 'FullForm' to see what kind of
graphics object the normal call produced, hoping to find a List of
tick marks that I could manually Reverse and reinsert, but found
nothing. Apparently 'AbsoluteOptions' allows one to peer more deeply
than 'FullForm'.

Thanks also to Martin and David, for showing solutions employing
Park's Presentation Package.

On Wed, Jul 18, 2012 at 4:48 AM, Bob Hanlon <hanlonr357@gmail.com> wrote:
> Show[plt = ListPlot[
> Transpose[{Range[6], Range[6]}]],
> Ticks -> {
> (Ticks /. AbsoluteOptions[plt, Ticks])[[1]] /.
> {x_, lbl_?NumericQ, r__} ->
> {x, 6 - lbl, r},
> Automatic}]
>
>
> Bob Hanlon
>
>
> On Wed, Jul 18, 2012 at 1:36 AM, James Stein <james@stein.org> wrote:

>> 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.
>>

Date Subject Author
7/19/12 Tomas Garza Hernandez
7/19/12 Bob Hanlon
7/19/12 James Stein