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

Home » Public Forums » archive » Re: tick text in stead of numbers
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 text in stead of numbers [message #54563] Tue, 26 June 2007 07:22 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Wox writes:

> Something like this?
>
> plot,indgen(12),XTICKN=string(bindgen(1,26)+65b),XTICKS=12,X TICKV=indgen(26)

Well, except for the fact that this gets the letters in
exactly the opposite order of the desired result, I guess
this is "something like" what you need. :-)

I would do it like this. But I note that U...A is not 12
letters, but 11. You need this from W...A if you are going
to do it correctly.

First, create this tick formatting function.

FUNCTION ValToStr, axis, index, value

letters = Reverse(Bindgen(26))
thisLetter = String(letters[2*index] + 62B)

RETURN, thisLetter
END

Then, apply it like this:

IDL> plot,indgen(12),XTICKS=11,XTICKFORMAT='valtostr'

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: tick text in stead of numbers
Next Topic: loading colors in tvscl

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

Current Time: Fri Oct 10 14:52:47 PDT 2025

Total time taken to generate the page: 1.20058 seconds