Re: Reversal of z axis object [message #16560] |
Sun, 01 August 1999 00:00  |
davidf
Messages: 2866 Registered: September 1996
|
Senior Member |
|
|
David Fanning (davidf@dfanning.com) writes:
> Waleed Al-Nuaimy (asger@gsiukltd.freeserve.co.uk) writes:
>
>> Hi. I'm trying to get my Z axis object to point downwards, i.e. have 0
>> at the top and
>> numbers increasing down the axis.
>>
>> Using a negative ZCOORD_CONV reverses the numbers but also gives me
>> mirror-image characters. Reversing the TickValues doesn't work either?
>
> I'm not absolutely sure about this, but somehow I vaguely
> recall that this was a problem that was suppose to get fixed.
> I'd check with RSI on this one.
I was just working through my Tips database, looking for tips
to put on my web page, and I came across this article posted
earlier this year by Mark Hadfield. Might be exactly what you
are looking for.
Cheers,
David
--
Subject: Re: Reversing an axis with IDLgrAxis
From: "Mark Hadfield" <m.hadfield@niwa.cri.nz>
Date: Tue, 2 Feb 1999 15:08:04 +1300
> OK, I give. I would like to plot an axis (object graphics) with values
> descending rather than ascending in the normal positive direction. I can do
> this using (XY)COORD_CONV, but when I do, the tick text and axis title are
> reversed as well (mirror image) and I can't figure out how to reverse them
> back to read normally.
Plot against the inverse of the variable and get the labels you want via
the TICKFORMAT property. The TICKFORMAT_NEGATIVE function below
is designed to do this.
----
Mark Hadfield, m.hadfield@niwa.cri.nz http://katipo.niwa.cri.nz/~hadfield/
National Institute for Water and Atmospheric Research
PO Box 14-901, Wellington, New Zealand
********************************
;+
; NAME:
; TICKFORMAT_NEGATIVE
;
; PURPOSE:
; This function is designed for use with the TICKFORMAT property of
IDLgrAxis.
; Given a real value, it returns a string representing the inverse of that
value.
;
; CATEGORY:
; Miscellaneous
; Object graphics
;
; CALLING SEQUENCE:
; Result = FUNCTION_NAME(Direction, Index, Value)
;
; INPUTS:
; Direction: Axis direction, required by the TICKFORMAT interface but
ignored.
;
; Index: Axis index, required by the TICKFORMAT interface but
ignored.
;
; Value: The real value to be formatted.
;
; OUTPUTS:
; The function returns a scalar string.
;
; EXPLANATION:
; IDLgrAxis objects always have the values increasing from left to right.
; The axis can be reversed, but then the axis labels are seen from behind!
; So to get an axis with values decreasing from left to right, we have to
; plot the inverse of the variable and reformat the axis labels.
;
; TO DO:
; Allow format control via the DATA keyword.
;
; MODIFICATION HISTORY:
; Mark Hadfield, Jun 1998:
; Written.
;-
function TICKFORMAT_NEGATIVE, Direction, Index, Value
return, (format_axis_values(-Value))[0]
end
--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
|
|
|