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

Home » Public Forums » archive » colorbar inside the plot
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
colorbar inside the plot [message #76361] Wed, 01 June 2011 12:31 Go to next message
kisCA is currently offline  kisCA
Messages: 78
Registered: January 2011
Member
Hi there,

I got this code which plot what i want but doesn't put the colorbar
outside of the plot as it used to... Any Ideas?

nlevels = 20
levels = -100+indgen(20)*10
pos = [0.1, 0.1, 0.9, 0.75]
LoadCT, 33, NColors=nlevels, Bottom=1
lonW=0 & lonE=360 & latS=-20 & latN=90 &
limitplot=[latS,lonW,latN,lonE]
map_set,/orthographic,34.5,-117.7,limit=limitplot
PS_start,filename='testpv.ps',/nomatch,charsize=0.8
cgcontour, pv,lon,lat, NLevels=nlevels,levels=levels, /
cell_Fill,C_Colors=Indgen(nlevels)
+1,xrange=[-180,179],xstyle=1,Position=pos,charsize=1,/close d,/
overplot
map_continents & map_grid
cgcolorbar, RANGE=[-100,100],NColors=nlevels, Bottom=1,
Format='(F0.1)',Divisions=nlevels/2, XMinor=0
Ps_end,/png

Thanks

Cheers
Re: colorbar inside the plot [message #76435 is a reply to message #76361] Thu, 02 June 2011 10:27 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
kisCA writes:

> My bet, there is a position keyword in map_set which is not detailed
> in IDL help but use in your book... I should have known now where to
> look first !!!

Ah, well, I just looked for it in the IDL 7.0 on-line help.
It's there, but you are right, it is NOT prominently
displayed. (It is under the Graphics Keywords section.)

But, yes, you should look in my books first. Most of what
I ever need to know is in one or the other of those
books! Or, if not there, in an article on my web page. ;-)

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 inside the plot [message #76436 is a reply to message #76361] Thu, 02 June 2011 09:56 Go to previous message
kisCA is currently offline  kisCA
Messages: 78
Registered: January 2011
Member
On Jun 1, 8:03 pm, David Fanning <n...@idlcoyote.com> wrote:
> kisCA writes:
>> Yes the problem come from overplot and i don't understand well the
>> map_projection, continents and grid...
>
>> I just want to have some space above the drawing to put the colorbar.
>
> Well, you just named three possibilities for doing so.
> Have you tried any of them? :-)
>
> Here is a suggestion. Stop doing all your plotting in
> PostScript. Draw your plots on the display where you
> can see what is happening, and try stepping through
> your code one command at at time. It might be
> illuminating. When you understand what your code
> does, *then* send it to a PostScript file.
>
> 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.")

My bet, there is a position keyword in map_set which is not detailed
in IDL help but use in your book... I should have known now where to
look first !!!

Thank you
Re: colorbar inside the plot [message #76446 is a reply to message #76361] Wed, 01 June 2011 20:03 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
kisCA writes:

> Yes the problem come from overplot and i don't understand well the
> map_projection, continents and grid...
>
> I just want to have some space above the drawing to put the colorbar.

Well, you just named three possibilities for doing so.
Have you tried any of them? :-)

Here is a suggestion. Stop doing all your plotting in
PostScript. Draw your plots on the display where you
can see what is happening, and try stepping through
your code one command at at time. It might be
illuminating. When you understand what your code
does, *then* send it to a PostScript file.

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 inside the plot [message #76447 is a reply to message #76361] Wed, 01 June 2011 19:51 Go to previous message
kisCA is currently offline  kisCA
Messages: 78
Registered: January 2011
Member
Yes the problem come from overplot and i don't understand well the
map_projection, continents and grid...

I just want to have some space above the drawing to put the colorbar.

Thanks
Re: colorbar inside the plot [message #76452 is a reply to message #76361] Wed, 01 June 2011 13:39 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
David Fanning writes:

>> when i change a value in pos (which i use in position in cgcontour).
>>
>> I started with pos = [0.1, 0.1, 0.9, 0.75] and change it in pos =
>> [0.1, 0.1, 0.4, 0.75] but it doesn't change anything on the plot
>
> Humm. Do you know for a fact that these values are being
> passed to cgContour? How would you test that? How would
> cgContour act if it never saw these values?

Oh, never mind. I just looked at your code again. It
is not cgContour that is creating the plot space.
cgContour is just drawing contours on a plot space
that already exists. So you are right, the POSITION
keyword is doing nothing, as it should when the OVERPLOT
keyword is set.

What command should you set the POSITION keyword on to
make it do some good in your program?

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 inside the plot [message #76455 is a reply to message #76361] Wed, 01 June 2011 13:28 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
kisCA writes:

> when i change a value in pos (which i use in position in cgcontour).
>
> I started with pos = [0.1, 0.1, 0.9, 0.75] and change it in pos =
> [0.1, 0.1, 0.4, 0.75] but it doesn't change anything on the plot

Humm. Do you know for a fact that these values are being
passed to cgContour? How would you test that? How would
cgContour act if it never saw these values?

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 inside the plot [message #76457 is a reply to message #76361] Wed, 01 June 2011 13:06 Go to previous message
kisCA is currently offline  kisCA
Messages: 78
Registered: January 2011
Member
On Jun 1, 12:57 pm, David Fanning <n...@idlcoyote.com> wrote:
> kisCA writes:
>> In fact, it's more a pb with cgcontour and position than the colorbar
>> pb. I should have said that i tried to move/change the cgcontour plot
>> while changing the pos array but nothing moves...
>
> Nothing moves when you do what? What have you tried?
>
> 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.")

when i change a value in pos (which i use in position in cgcontour).

I started with pos = [0.1, 0.1, 0.9, 0.75] and change it in pos =
[0.1, 0.1, 0.4, 0.75] but it doesn't change anything on the plot
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Error when using !NULL as a property value. Bug or feature?
Next Topic: IDL 8 on a Laptop

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

Current Time: Wed Oct 08 13:46:24 PDT 2025

Total time taken to generate the page: 0.00649 seconds