Re: tick text in stead of numbers [message #54563] |
Tue, 26 June 2007 07:22 |
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.")
|
|
|
Re: tick text in stead of numbers [message #54564 is a reply to message #54563] |
Tue, 26 June 2007 02:43  |
Wox
Messages: 184 Registered: August 2006
|
Senior Member |
|
|
On Tue, 26 Jun 2007 01:24:09 -0700, maffie
<matthias.demuzere@geo.kuleuven.be> wrote:
> Dear all,
>
> Probably a quite easy one to solve, but I seem not to find it. I have
> an X-axis numbered from 0 to 11, and I would like to change these
> number values to the following string values 'U', ....'A' (also 12
> values). By which command can I do that???
>
> Thanks a lot!
> Best Regards,
> Matthias
Something like this?
plot,indgen(12),XTICKN=string(bindgen(1,26)+65b),XTICKS=12,X TICKV=indgen(26)
|
|
|
Re: tick text in stead of numbers [message #54565 is a reply to message #54564] |
Tue, 26 June 2007 02:01  |
raval.chintan
Messages: 54 Registered: May 2005
|
Member |
|
|
On Jun 26, 1:24 pm, maffie <matthias.demuz...@geo.kuleuven.be> wrote:
> Dear all,
>
> Probably a quite easy one to solve, but I seem not to find it. I have
> an X-axis numbered from 0 to 11, and I would like to change these
> number values to the following string values 'U', ....'A' (also 12
> values). By which command can I do that???
>
> Thanks a lot!
> Best Regards,
> Matthias
When putting tick marks ... try out this ...
print,string(65b)
It will print A. Here 65 is ascii number for A... same way you can
find ascii for U.
Regards
Chintan
|
|
|