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

Home » Public Forums » archive » Re: Tick formatting
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: Tick formatting [message #29144] Sun, 03 February 2002 12:53 Go to previous message
Mark Hadfield is currently offline  Mark Hadfield
Messages: 783
Registered: May 1995
Senior Member
<gary.hodgesREMOVE@cires.colorado.edu> wrote in message
news:a3esa9$eri$1@news.nems.noaa.gov...
> I've almost got what I'm after...
>
> I'm plotting data that runs from zero to 180 degrees. I'd like my
> ticks/labels to go zero -> 90 -> zero. The X axis will actually run
from -5
> to 185, but I would like the ticks and labels to start and end at the zero
> and 180 positions. What I want to end with should look like (ticks
centered
> on numbers of course):
>
> | | | | | | | | | | | | |
> 0 15 30 45 60 75 90 75 60 45 30 15 0
>
> I'm getting an extra zero, i.e., 0 0 15 30, and the values are right
> displaced under the tickmark. This is my best reproduction...
>
> | | | | | | | | | | | | |
> 0 0 15 30 45 60 75 90 75 60 45 30 15 0
>
> I've set the following:
>
> !X.TICKS=13
> !X.TICKV=[0,15,30,45,60,75,90,105,120,135,150,165,180]
> !X.TICKNAME=[0,15,30,45,60,75,90,75,60,45,30,15,0]

As a general rule, you can get more robust and simpler code if you avoid
specifying TICKNAME directly. Try to use TICKFORMAT instead. Define a
function something like this:

function myticks, direction, index, value, level
compile_opt IDL2
;; Warning: not tested!
return, strtrim(round(value < (180-value))
end

and specify !X.TICKFORMAT='myticks'. This doesn't avoid the need to also
specify !X.TICKS and/or !X.TICKV but it avoids the risk that your tick
labels will look right but actually be incorrect.

---
Mark Hadfield
m.hadfield@niwa.co.nz http://katipo.niwa.co.nz/~hadfield
National Institute for Water and Atmospheric Research
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Color text within WIDGET_TEXT?
Next Topic: Double-precision plotting doesn't work in object graphics

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

Current Time: Tue Dec 02 20:05:27 PST 2025

Total time taken to generate the page: 0.01228 seconds