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

Home » Public Forums » archive » Re: FSC_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: FSC_COLORBAR [message #77409] Thu, 01 September 2011 14:28 Go to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Bob writes:

> I really like cgColorbar but it needs two small changes
> to really work right. These are to change the default format
> to '' and divisions to 0 (ie, let plot choose). See below
> for a diff. If you try the following with the default
> and modified version it will be clear why these are
> better defaults:

I guess a definition of "work right" depends on what
you do with it. cgColorbar has "worked right" for me
for quite a few years. :-)

Getting a color bar to "work right" is probably why
IDL never provided one. This routine, probably more
than most, allows you to do pretty much everything
that needs to be done. In that sense, it probably
works OK, at the very least.

But, you may be right. I know I chose the default
format of "I0" specifically so that it would be "wrong"
in some instances so that people would have to go
looking for how to make it right. After I did that,
and people discovered that there was actually
documentation in the file(!), my support calls went
way down. :-)

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: FSC_COLORBAR [message #77410 is a reply to message #77409] Thu, 01 September 2011 14:12 Go to previous messageGo to next message
Bob[4] is currently offline  Bob[4]
Messages: 24
Registered: April 2009
Junior Member
I really like cgColorbar but it needs two small changes to really work right. These are to change the default format to '' and divisions to 0 (ie, let plot choose). See below for a diff. If you try the following with the default and modified version it will be clear why these are better defaults:

cgcolorbar, minrange=-1, maxrange=1

diff a/cgcolorbar.pro b/cgcolorbar.pro
84c84
< ; be (divisions + 1) annotations. The default is 6.
---
> ; be (divisions + 1) annotations. The default is chosen internally.
94c94
< ; FORMAT: The format of the bar annotations. Default is '(I0)'.
---
> ; FORMAT: The format of the bar annotations. Default is ''.
368c368
< IF N_ELEMENTS(format) EQ 0 THEN format = '(I0)'
---
> IF N_ELEMENTS(format) EQ 0 THEN format = ''
378c378
< IF N_ELEMENTS(divisions) EQ 0 THEN divisions = 6
---
> IF N_ELEMENTS(divisions) EQ 0 THEN divisions = 0
Re: FSC_COLORBAR [message #77414 is a reply to message #77410] Wed, 31 August 2011 16:45 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Esquerdo writes:

> I have a PC intel core i5, it's an usual desktop.
> My only library installed in the machine is the Coyote!
> I didn't know there was a better routine to draw color bars. I'll try
> to use cgColorbar.

Better get the book! Today is the last day of the
sale. :-)

http://www.idlcoyote.com/books/

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: FSC_COLORBAR [message #77415 is a reply to message #77414] Wed, 31 August 2011 16:37 Go to previous messageGo to next message
Jeff[2] is currently offline  Jeff[2]
Messages: 18
Registered: November 2007
Junior Member
On Aug 31, 7:49 pm, David Fanning <n...@dfanning.com> wrote:
> Vito writes:
>> Yes, the command printed out only my Coyote Library!
>
>> I have installed in my PC both IDL versions, 7.0 and 8.0. Could that
>> be a problem?
>
>> I checked my code and everything seems to be right, since it works in
>> version 7.0.
>
>> Another error message I got in IDL 8.0 is "Error in Draw Method.
>> Returning..." :-(
>
> Well, I'm not convinced. What kind of a machine are you
> running this on? :-)
>
> Do you have any astronomy library installed? In particular,
> do you have the SolarSoft library installed?
>
> Is there a particular reason you want to use this
> object color bar anyway? I'll be honest with you,
> I think I've used it twice in my life. I just find
> cgColorbar so much more convenient for nearly everything
> I do that needs a color bar.
>
> 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.")

I have a PC intel core i5, it's an usual desktop.
My only library installed in the machine is the Coyote!
I didn't know there was a better routine to draw color bars. I'll try
to use cgColorbar.
Thanks for the tip.
Vito
Re: FSC_COLORBAR [message #77416 is a reply to message #77415] Wed, 31 August 2011 15:49 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Vito writes:

> Yes, the command printed out only my Coyote Library!
>
> I have installed in my PC both IDL versions, 7.0 and 8.0. Could that
> be a problem?
>
> I checked my code and everything seems to be right, since it works in
> version 7.0.
>
> Another error message I got in IDL 8.0 is "Error in Draw Method.
> Returning..." :-(

Well, I'm not convinced. What kind of a machine are you
running this on? :-)

Do you have any astronomy library installed? In particular,
do you have the SolarSoft library installed?

Is there a particular reason you want to use this
object color bar anyway? I'll be honest with you,
I think I've used it twice in my life. I just find
cgColorbar so much more convenient for nearly everything
I do that needs a color bar.

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: FSC_COLORBAR [message #77417 is a reply to message #77416] Wed, 31 August 2011 15:20 Go to previous messageGo to next message
Vito is currently offline  Vito
Messages: 3
Registered: August 2011
Junior Member
On Aug 31, 5:40 pm, David Fanning <n...@dfanning.com> wrote:
> Vito writes:
>> I was using colorbar__define.pro routine to draw colobars and it
>> worked fine in IDL 7.0. But now, with the 8.0 version, I'm using
>> fsc_colobar.pro function and it doesn't work. I got the message:
>
>> FSC_Colorbar::Draw Method: Attempt to call undefined method:
>> 'FSC_COLORBAR::POSITION'.
>
>> When I run the same code using fsc_colobar.pro in IDL 7.0 it works!!
>> But in IDL 8.0 the same code is not working.
>
>> Anyone else has had this problem?
>
> No. :-)
>
> I would suspect a Library conflict with some other software.
> What happens when you type this command:
>
>    IDL> Print, File_Which('fsc_colorbar__define.pro')
>
> Does that print out the location of your one and only
> Coyote Library? :-)
>
> 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.")

Hi David, thanks for answering.

Yes, the command printed out only my Coyote Library!

I have installed in my PC both IDL versions, 7.0 and 8.0. Could that
be a problem?

I checked my code and everything seems to be right, since it works in
version 7.0.

Another error message I got in IDL 8.0 is "Error in Draw Method.
Returning..." :-(

Vito.
Re: FSC_COLORBAR [message #77418 is a reply to message #77417] Wed, 31 August 2011 13:40 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Vito writes:

> I was using colorbar__define.pro routine to draw colobars and it
> worked fine in IDL 7.0. But now, with the 8.0 version, I'm using
> fsc_colobar.pro function and it doesn't work. I got the message:
>
> FSC_Colorbar::Draw Method: Attempt to call undefined method:
> 'FSC_COLORBAR::POSITION'.
>
> When I run the same code using fsc_colobar.pro in IDL 7.0 it works!!
> But in IDL 8.0 the same code is not working.
>
> Anyone else has had this problem?

No. :-)

I would suspect a Library conflict with some other software.
What happens when you type this command:

IDL> Print, File_Which('fsc_colorbar__define.pro')

Does that print out the location of your one and only
Coyote Library? :-)

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: FSC_COLORBAR [message #77508 is a reply to message #77409] Thu, 01 September 2011 14:36 Go to previous message
Bob[4] is currently offline  Bob[4]
Messages: 24
Registered: April 2009
Junior Member
OK, perhaps I should have said "work better" :-)

Did you try the example I gave w/ and w/o the changes?

Bob
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: cgWindow Update
Next Topic: Font Tables Gone

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

Current Time: Wed Oct 08 15:40:11 PDT 2025

Total time taken to generate the page: 0.01563 seconds