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

Home » Public Forums » archive » Re: Alternative [XY]ticknames on colorbar
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Alternative [XY]ticknames on colorbar [message #39380] Wed, 12 May 2004 06:59
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Einar M. Einarsson writes:

> It's works fine! And I have to agree that RSI itself should come up
> with some handy colorbar tool. T

I've added a TICKNAMES keyword to the COLORBAR procedure
so that this is now easier to do. When TICKNAMES is present,
the FORMAT is automatically set equal to a null string.

http://www.dfanning.com/programs/colorbar.pro

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Re: Alternative [XY]ticknames on colorbar [message #39381 is a reply to message #39380] Wed, 12 May 2004 06:09 Go to previous message
einareinar is currently offline  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 Go to previous message
David Fanning is currently offline  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/
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: colorbar and [XY]tickname
Next Topic: Re: STRING( ) confusion

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

Current Time: Wed Oct 08 19:52:18 PDT 2025

Total time taken to generate the page: 0.00599 seconds