comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Reversing an axis with IDLgrAxis
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Reversing an axis with IDLgrAxis [message #14204 is a reply to message #14194] Tue, 02 February 1999 00:00 Go to previous messageGo to previous message
Mark Hadfield is currently offline  Mark Hadfield
Messages: 783
Registered: May 1995
Senior Member
> 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
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: !P.MULTI + POSITION keyword problem
Next Topic: Color in emacs IDL mode

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Oct 11 08:40:24 PDT 2025

Total time taken to generate the page: 1.19653 seconds