|
Re: Alternative [XY]ticknames on colorbar [message #39381 is a reply to message #39380] |
Wed, 12 May 2004 06:09  |
einareinar
Messages: 4 Registered: May 2004
|
Junior Member |
|
|
David Fanning <david@dfanning.com> wrote in message news:<MPG.1b0a80105c431cb7989748@news.frii.com>...
> 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
Thanks!
It's works fine! And I have to agree that RSI itself should come up
with some handy colorbar tool. The final product can be shown here if
someone is intrested!: http://www.os.is/~or/vedurspa/A.html
best regards
Einar
|
|
|
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/
|
|
|