| Re: Alternative [XY]ticknames on colorbar [message #39405 is a reply to message #39381] |
Tue, 11 May 2004 06:16  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Einar M. Einarsson writes:
> Can someone (David?) tell me how to get alternative labels on David's
> colorbar?
> I wanted to ask you guys if I could avoid changing his program.
>
> Here is my code:
>
> print, names
> help,names
>
> colorbar, /vertical, $
> Position = col_pos, $
> Range=[0,r_levels(n_elements(r_levels)-1)], $
> NColors=n_elements(r_levels)-1, $
> Bottom=101, $
> Color=!P.color, $
> Divisions=n_elements(r_levels)-1,$
> /right, $
> TITLE='mm/3klst',$
> ytickname=names,$
> format='(A2)'
>
> And here is the resault from the print/help functions:
> 0 1 2 3 4 5 10
> 15 20
> NAMES STRING = Array[9]
>
> Isn't the _EXTRA keyword supposed to pass ytickname to the AXIS
> procedure? And it it doesn't matter if names are a integer array and
> format='(I2)'
Well, this is a fairly subtle problem, it seems to me
after I've puzzled over it for an hour. I think it
boils down to the fact that you don't want to simultaneously
use strings for your plot annotations AND use the FORMAT
keyword. I guess this makes sense. If you are asking IDL
to use strings you have provided, then the format will be
determined by the strings.
Bottom line, I think this call above will work if you set
the FORMAT keyword equal to a null string (ie, FORMAT='').
This will have to be done for COLORBAR *whenever* you provide
the TICKNAME keyword.
I've resisted making COLORBAR too sophisticated, because I
think it is really RSI's responsibility to provide this kind
of program, not mine. But I'll think about adding a TICKNAME
keyword to the program. :-)
Cheers,
David
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|
|