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

Home » Public Forums » archive » Re: Colorbar with fixed level and color
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: Colorbar with fixed level and color [message #81409] Mon, 17 September 2012 05:37 Go to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Rosie writes:

> Though it ran perfectly alright in unix, but in windows
> it shows: 'attempt to call undefined procedure/function
> cgLoadct'. However, in windows when I put Loadct, it
> accepts the command. Do you think I should reinstall IDL?

No, I think you should download the most recent Coyote
Library and somehow get it on your IDL path. :-)

Cheers,

David



--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: Colorbar with fixed level and color [message #81410 is a reply to message #81409] Mon, 17 September 2012 05:31 Go to previous messageGo to next message
Rosie is currently offline  Rosie
Messages: 27
Registered: September 2012
Junior Member
On Sunday, September 16, 2012 11:43:47 PM UTC+1, David Fanning wrote:
> Rosie writes:
>
>
>
>> 1.It is working in unix, though cgerase or other cg command
>
>> is not working in windows environment. Also Brewer command
>
>> seems not working in windows.
>
>
>
> I spend my life working in a Windows environment, so I'm
>
> pretty sure the Coyote Graphics routines work there. :-)
>
>
>
> It seems more likely to me that the Library hasn't been
>
> installed properly. Read the directions carefully:
>
>
>
> http://www.idlcoyote.com/code_tips/installcoyote.php
>
>
>
> What gives you the impression they don't work?
>
>
>
>> 2.If I want to specify colorbar at bottom of contour plot, then
>
>> I need to put position command on contour command as well
>
>> as on colorbar command?
>
>
>
> Yes, if you need more space, you must position things accordingly.
>
>
>
>> 3.I want to draw smooth contouring of z1. Shall I put it as
>
>> z1=smooth(z1,2) and then contour,z1?
>
>
>
> Smoothing will help, although the second parameter to Smooth
>
> must be at least a 3 to do any good. It should also be an
>
> odd number.
>
>
>
>> 4.I want to thicken the zero line.
>
>
>
> You may have to draw this thicker after the fact. cgPlotS
>
> should work. You can use the usual ![XY].Window or ![XY].CRange
>
> system variables to work out where to draw.
>
>
>
>> 5. For showing significant test, I put c_orient=45. If I only
>
>> want to see dot instead of hatching, can I do that?
>
>
>
> I don' know off-hand. It has been 20 years or so since I
>
> have used fill patterns. And I'm off to staff a Poudre
>
> Wilderness Volunteers booth at a local fair today. But,
>
> I would investigate how to create fill patterns.
>
>
>
> Cheers,
>
>
>
> David
>
>
>
>
>
>
>
>
>
> --
>
> David Fanning, Ph.D.
>
> Fanning Software Consulting, Inc.
>
> Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
>
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")

Dear David,

Thank you so much for all the information.

Though it ran perfectly alright in unix, but in windows it shows: 'attempt to call undefined procedure/function cgLoadct'. However, in windows when I put Loadct, it accepts the command. Do you think I should reinstall IDL?


Regards,
Re: Colorbar with fixed level and color [message #81414 is a reply to message #81410] Sun, 16 September 2012 15:43 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Rosie writes:

> 1.It is working in unix, though cgerase or other cg command
> is not working in windows environment. Also Brewer command
> seems not working in windows.

I spend my life working in a Windows environment, so I'm
pretty sure the Coyote Graphics routines work there. :-)

It seems more likely to me that the Library hasn't been
installed properly. Read the directions carefully:

http://www.idlcoyote.com/code_tips/installcoyote.php

What gives you the impression they don't work?

> 2.If I want to specify colorbar at bottom of contour plot, then
> I need to put position command on contour command as well
> as on colorbar command?

Yes, if you need more space, you must position things accordingly.

> 3.I want to draw smooth contouring of z1. Shall I put it as
> z1=smooth(z1,2) and then contour,z1?

Smoothing will help, although the second parameter to Smooth
must be at least a 3 to do any good. It should also be an
odd number.

> 4.I want to thicken the zero line.

You may have to draw this thicker after the fact. cgPlotS
should work. You can use the usual ![XY].Window or ![XY].CRange
system variables to work out where to draw.

> 5. For showing significant test, I put c_orient=45. If I only
> want to see dot instead of hatching, can I do that?

I don' know off-hand. It has been 20 years or so since I
have used fill patterns. And I'm off to staff a Poudre
Wilderness Volunteers booth at a local fair today. But,
I would investigate how to create fill patterns.

Cheers,

David




--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: Colorbar with fixed level and color [message #81415 is a reply to message #81414] Sun, 16 September 2012 05:08 Go to previous messageGo to next message
Rosie is currently offline  Rosie
Messages: 27
Registered: September 2012
Junior Member
On Friday, September 14, 2012 4:13:13 PM UTC+1, Rosie wrote:
> On Friday, September 14, 2012 2:58:11 PM UTC+1, David Fanning wrote:
>
>> Rosie,
>
>>
>
>>
>
>>
>
>> You may prefer this color bar:
>
>>
>
>>
>
>>
>
>> nl=19; nl,number of level
>
>>
>
>> level=findgen(nl)*.5-4.5
>
>>
>
>> names = String(level, Format='(f0.1)')
>
>>
>
>> names[[0,18]]=" "
>
>>
>
>> names[Indgen(9)*2+1] = " "
>
>>
>
>> names[0] = '<-4.5'
>
>>
>
>> names[18] = '>4.5'
>
>>
>
>> cgerase
>
>>
>
>> cgLoadCT, 25, NColors=20, Bottom=1, /Brewer
>
>>
>
>> cgColorBar, NColors=18, Bottom=2, Division=18, $
>
>>
>
>> Range=[Min(level),Max(level)], TickNames=names, $
>
>>
>
>> TickLen=1.0, OOB_Low=1, OOB_High=20
>
>>
>
>>
>
>>
>
>> Cheers,
>
>>
>
>>
>
>>
>
>> David
>
>>
>
>>
>
>>
>
>>
>
>>
>
>>
>
>>
>
>> --
>
>>
>
>> David Fanning, Ph.D.
>
>>
>
>> Fanning Software Consulting, Inc.
>
>>
>
>> Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
>
>>
>
>> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
>
>
>
> Dear David,
>
>
>
> Such a nice colour table !!
>
> Regards,

Dear David,

1.It is working in unix, though cgerase or other cg command is not working in windows environment. Also Brewer command seems not working in windows.

2.If I want to specify colorbar at bottom of contour plot, then I need to put position command on contour command as well as on colorbar command?

3.I want to draw smooth contouring of z1. Shall I put it as
z1=smooth(z1,2) and then contour,z1?

4.I want to thicken the zero line.

5. For showing significant test, I put c_orient=45. If I only want to see dot instead of hatching, can I do that?

Regards,
Rosie
Re: Colorbar with fixed level and color [message #81419 is a reply to message #81415] Fri, 14 September 2012 08:13 Go to previous messageGo to next message
Rosie is currently offline  Rosie
Messages: 27
Registered: September 2012
Junior Member
On Friday, September 14, 2012 2:58:11 PM UTC+1, David Fanning wrote:
> Rosie,
>
>
>
> You may prefer this color bar:
>
>
>
> nl=19; nl,number of level
>
> level=findgen(nl)*.5-4.5
>
> names = String(level, Format='(f0.1)')
>
> names[[0,18]]=" "
>
> names[Indgen(9)*2+1] = " "
>
> names[0] = '<-4.5'
>
> names[18] = '>4.5'
>
> cgerase
>
> cgLoadCT, 25, NColors=20, Bottom=1, /Brewer
>
> cgColorBar, NColors=18, Bottom=2, Division=18, $
>
> Range=[Min(level),Max(level)], TickNames=names, $
>
> TickLen=1.0, OOB_Low=1, OOB_High=20
>
>
>
> Cheers,
>
>
>
> David
>
>
>
>
>
>
>
> --
>
> David Fanning, Ph.D.
>
> Fanning Software Consulting, Inc.
>
> Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
>
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")

Dear David,

Such a nice colour table !!
Regards,
Re: Colorbar with fixed level and color [message #81420 is a reply to message #81419] Fri, 14 September 2012 06:57 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Rosie,

You may prefer this color bar:

nl=19; nl,number of level
level=findgen(nl)*.5-4.5
names = String(level, Format='(f0.1)')
names[[0,18]]=" "
names[Indgen(9)*2+1] = " "
names[0] = '<-4.5'
names[18] = '>4.5'
cgerase
cgLoadCT, 25, NColors=20, Bottom=1, /Brewer
cgColorBar, NColors=18, Bottom=2, Division=18, $
Range=[Min(level),Max(level)], TickNames=names, $
TickLen=1.0, OOB_Low=1, OOB_High=20

Cheers,

David



--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: Colorbar with fixed level and color [message #81421 is a reply to message #81420] Fri, 14 September 2012 06:49 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
David Fanning writes:

> cgLoadCT, 25, Clip=[50,254], NColors=18, Bottom=2, /Brewer

Whoops, no reason to clip this color table any more,
if I am using a different color table. I'd change this
to this:

cgLoadCT, 25, NColors=18, Bottom=2, /Brewer

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: Colorbar with fixed level and color [message #81422 is a reply to message #81421] Fri, 14 September 2012 06:45 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Rosie writes:

> Few more questions:
>
> 1)Can I do less than -4 with < sign and more than +4 with > sign ?
> 2)Another problem is with green colour, they can hardly be differentiated.
> 3)I used the command division=10, minor=2. But it did not worked.

That color table is an ugly one. ;-)

I think I might try something like this:

nl=19; nl,number of level
level=findgen(nl)*.5-4.5
names = String(level, Format='(f0.1)')
names[[0,18]]=" "
names[Indgen(9)*2+1] = " "
names[0] = '<-4.5'
names[18] = '>4.5'
cgerase
cgLoadCT, 25, Clip=[50,254], NColors=18, Bottom=2, /Brewer
TVLCT, cgColor('red', /Triple), 1
TVLCT, cgColor('blue', /Triple), 20
cgColorBar, NColors=18, Bottom=2, Division=18, $
Range=[Min(level),Max(level)], TickNames=names, $
TickLen=1.0, OOB_Low=1, OOB_High=20

Cheers,

David


--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: Colorbar with fixed level and color [message #81424 is a reply to message #81422] Fri, 14 September 2012 06:12 Go to previous messageGo to next message
Rosie is currently offline  Rosie
Messages: 27
Registered: September 2012
Junior Member
On Friday, September 14, 2012 1:53:07 PM UTC+1, Rosie wrote:
> On Friday, September 14, 2012 1:13:04 PM UTC+1, David Fanning wrote:
>
>> Rosie writes:
>
>>
>
>>
>
>>
>
>>>
>
>>
>
>>> Hello,
>
>>
>
>>>
>
>>
>
>>> I have created contour plot with following color and levels
>
>>
>
>>>
>
>>
>
>>> loadct,39
>
>>
>
>>> nl=21; nl,number of level
>
>>
>
>>> color=(findgen(nl+1)*10)+50
>
>>
>
>>> level=findgen(nl)*.5-5
>
>>
>
>>>
>
>>
>
>>> Would anyone kindly tell how to plot colorbar with this specification.
>
>>
>
>>
>
>>
>
>> Well, those specifications don't make too much sense, since
>
>>
>
>> there is no "color" at index 260. But, what I *think* you
>
>>
>
>> are trying to do is something like this:
>
>>
>
>>
>
>>
>
>> cgLoadCT, 39, Clip=[50,254], NColors=20, Bottom=1
>
>>
>
>> cgColorBar, NColors=20, Bottom=1, /Discrete, $
>
>>
>
>> Range=[Min(level),Max(level)], Charsize=0.75
>
>>
>
>>
>
>>
>
>> Cheers,
>
>>
>
>>
>
>>
>
>> David
>
>>
>
>> --
>
>>
>
>> David Fanning, Ph.D.
>
>>
>
>> Fanning Software Consulting, Inc.
>
>>
>
>> Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
>
>>
>
>> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
>
>
>
> Thanks a lot, David. It worked !
>
> Regards,
Few more questions:

1)Can I do less than -4 with < sign and more than +4 with > sign ?
2)Another problem is with green colour, they can hardly be differentiated.
3)I used the command division=10, minor=2. But it did not worked.

Regards,
Rosie
Re: Colorbar with fixed level and color [message #81426 is a reply to message #81424] Fri, 14 September 2012 05:53 Go to previous messageGo to next message
Rosie is currently offline  Rosie
Messages: 27
Registered: September 2012
Junior Member
On Friday, September 14, 2012 1:13:04 PM UTC+1, David Fanning wrote:
> Rosie writes:
>
>
>
>>
>
>> Hello,
>
>>
>
>> I have created contour plot with following color and levels
>
>>
>
>> loadct,39
>
>> nl=21; nl,number of level
>
>> color=(findgen(nl+1)*10)+50
>
>> level=findgen(nl)*.5-5
>
>>
>
>> Would anyone kindly tell how to plot colorbar with this specification.
>
>
>
> Well, those specifications don't make too much sense, since
>
> there is no "color" at index 260. But, what I *think* you
>
> are trying to do is something like this:
>
>
>
> cgLoadCT, 39, Clip=[50,254], NColors=20, Bottom=1
>
> cgColorBar, NColors=20, Bottom=1, /Discrete, $
>
> Range=[Min(level),Max(level)], Charsize=0.75
>
>
>
> Cheers,
>
>
>
> David
>
> --
>
> David Fanning, Ph.D.
>
> Fanning Software Consulting, Inc.
>
> Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
>
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")

Thanks a lot, David. It worked !
Regards,
Re: Colorbar with fixed level and color [message #81428 is a reply to message #81426] Fri, 14 September 2012 05:12 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Rosie writes:

>
> Hello,
>
> I have created contour plot with following color and levels
>
> loadct,39
> nl=21; nl,number of level
> color=(findgen(nl+1)*10)+50
> level=findgen(nl)*.5-5
>
> Would anyone kindly tell how to plot colorbar with this specification.

Well, those specifications don't make too much sense, since
there is no "color" at index 260. But, what I *think* you
are trying to do is something like this:

cgLoadCT, 39, Clip=[50,254], NColors=20, Bottom=1
cgColorBar, NColors=20, Bottom=1, /Discrete, $
Range=[Min(level),Max(level)], Charsize=0.75

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: Colorbar with fixed level and color [message #84204 is a reply to message #81409] Mon, 06 May 2013 09:07 Go to previous message
Rosie is currently offline  Rosie
Messages: 27
Registered: September 2012
Junior Member
On Monday, September 17, 2012 1:37:34 PM UTC+1, David Fanning wrote:
> Rosie writes:
>
>
>
>> Though it ran perfectly alright in unix, but in windows
>
>> it shows: 'attempt to call undefined procedure/function
>
>> cgLoadct'. However, in windows when I put Loadct, it
>
>> accepts the command. Do you think I should reinstall IDL?
>
>
>
> No, I think you should download the most recent Coyote
>
> Library and somehow get it on your IDL path. :-)
>
>
>
> Cheers,
>
>
>
> David
>
>
>
>
>
>
>
> --
>
> David Fanning, Ph.D.
>
> Fanning Software Consulting, Inc.
>
> Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
>
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")

Dear David,

It is working perfect now. Here I have few queries:

1. To match color of zero level in contour to that with colour bar, I used following commands for my plot and it is working. But colours shift in blue direction in one step.I tried with 'bottom'=2 or =1 in both cases for colourbar and table, but it is not matching together.

nl=13
level=(findgen(nl)*.5-3)
colour=(findgen(nl+1))
cgerase
cgLoadCT, 24, NColors=14, Bottom=2, /Brewer,/reverse
cgColorBar,NColors=14, bottom=1, Division=14

2. Can I simply make white on both sides of zero contour?

3. The colour you specified are really nice. But can I change those colours a bit, say for both blue or red can they be little lighter? or say can they be purple and orange?

Thanks and regards,
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Widget Hyperlink
Next Topic: IDL workbench & xquartz

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

Current Time: Wed Oct 08 13:31:38 PDT 2025

Total time taken to generate the page: 0.00923 seconds