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

Home » Public Forums » archive » Re: Contour Plot w/ 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: Contour Plot w/ Colorbar [message #74713] Tue, 01 February 2011 09:26 Go to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Ammar Yusuf writes:

> Also you mentioned something about normalized coordinates in your next
> post. Is there another type of positioning?

Not really, no.

I would do something like this:

data = LoadData(2)
CTLoad, 33
FSC_Contour, data, NLevels=12, /FILL, $
Position=[0.1, 0.1, 0.82, 0.9], /Window
FSC_Contour, data, /Overplot, Color='gray', /AddCmd
FSC_Colorbar, /Vertical, /Right, Divisions=5, $
Range=[Min(data),Max(data)], $
Position=[0.85, 0.1, 0.89, 0.9], /AddCmd

Then, just choose the Send to PostScript button and
your PostScript output will look identical to what
you see on the display. :-)

You can find all the Coyote Library files you need
here:

http://www.idlcoyote.com/programs/coyoteprograms.zip

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: Contour Plot w/ Colorbar [message #74715 is a reply to message #74713] Tue, 01 February 2011 09:02 Go to previous messageGo to next message
Ammar Yusuf is currently offline  Ammar Yusuf
Messages: 36
Registered: October 2010
Member
On Feb 1, 10:40 am, David Fanning <n...@dfanning.com> wrote:
> Ammar Yusuf writes:
>> Yea I tried changing the position but then it's starting to make the
>> colorbar really thin and I still couldn't get all the numbers inside.
>> Is there anyway to increase the box or something that it plots the
>> postscript file to?
>
> Why don't you try moving the contour plot to the left,
> so you have more room for the colorbar? Move *everything*
> to the left!
>
> 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.")

Yea I'm not sure how I would do that. I'm assuming positioning but not
sure exactly what to position. I have this code now:

contour, data, x, y, max_value = max_bright, min_value = min_bright, $
/Fill, C_Colors = indgen(levels), background = 1, xstyle = 4, $
ystyle = 4, levels = userLevels, /normal, color = black, $
Position = [0.001, 0.1, 0.75, 0.80]

colorBar, NColors=levels, divisions=6, Range = [min_data, max_data], $
format='(I5)', Position = [0.80, 0.10, 0.81, 0.90], Color = black,
$
/vertical, /right

The contour image looks a little distorted and I got the color bar in
the box with numbers but it's really thin.

Also you mentioned something about normalized coordinates in your next
post. Is there another type of positioning?

Thanks.
Re: Contour Plot w/ Colorbar [message #74721 is a reply to message #74715] Tue, 01 February 2011 07:44 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Ammar Yusuf writes:

> Yea I tried changing the position but then it's starting to make the
> colorbar really thin and I still couldn't get all the numbers inside.
> Is there anyway to increase the box or something that it plots the
> postscript file to?

Because you are positioning your contour plot and the
color bar in normalized coordinates, it doesn't matter
HOW big the PostScript "box" is, the color bar isn't
going to fit. You are just going to have to give it
more room. :-)

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: Contour Plot w/ Colorbar [message #74722 is a reply to message #74721] Tue, 01 February 2011 07:40 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Ammar Yusuf writes:

> Yea I tried changing the position but then it's starting to make the
> colorbar really thin and I still couldn't get all the numbers inside.
> Is there anyway to increase the box or something that it plots the
> postscript file to?

Why don't you try moving the contour plot to the left,
so you have more room for the colorbar? Move *everything*
to the left!

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: Contour Plot w/ Colorbar [message #74723 is a reply to message #74722] Tue, 01 February 2011 07:38 Go to previous messageGo to next message
Ammar Yusuf is currently offline  Ammar Yusuf
Messages: 36
Registered: October 2010
Member
> You just need to leave more room for your colorbar.
> Move every thing over to the left. :-)
>
> 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.")

Yea I tried changing the position but then it's starting to make the
colorbar really thin and I still couldn't get all the numbers inside.
Is there anyway to increase the box or something that it plots the
postscript file to?
Thanks.
Re: Contour Plot w/ Colorbar [message #74724 is a reply to message #74723] Tue, 01 February 2011 07:24 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Ammar Yusuf writes:

> Here's a picture I have: http://i.imgur.com/9tmJ2.png. It's of a
> contour with the color on the side vertically. The problem I'm having
> is that the numbers are not showing up on the colorbar and they cut
> off when I pull up the postscript file to excel. Here are the relevant
> calls that I'm making in IDL.

You just need to leave more room for your colorbar.
Move every thing over to the left. :-)

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: Contour Plot w/ Colorbar [message #74800 is a reply to message #74713] Tue, 01 February 2011 16:31 Go to previous message
Ammar Yusuf is currently offline  Ammar Yusuf
Messages: 36
Registered: October 2010
Member
On Feb 1, 12:26 pm, David Fanning <n...@dfanning.com> wrote:
> Ammar Yusuf writes:
>> Also you mentioned something about normalized coordinates in your next
>> post. Is there another type of positioning?
>
> Not really, no.
>
> I would do something like this:
>
> data = LoadData(2)
> CTLoad, 33
> FSC_Contour, data, NLevels=12, /FILL, $
>     Position=[0.1, 0.1, 0.82, 0.9], /Window
> FSC_Contour, data, /Overplot, Color='gray', /AddCmd
> FSC_Colorbar, /Vertical, /Right, Divisions=5, $
>     Range=[Min(data),Max(data)], $
>     Position=[0.85, 0.1, 0.89, 0.9], /AddCmd
>
> Then, just choose the Send to PostScript button and
> your PostScript output will look identical to what
> you see on the display. :-)
>
> You can find all the Coyote Library files you need
> here:
>
>   http://www.idlcoyote.com/programs/coyoteprograms.zip
>
> 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.")

Hi David,

I did that but I got this error: http://i.imgur.com/6R6Mr.png.
Then what happened after I clicked okay was it started opening up
windows continuously on taskbar and it would not stop.
It just kept going and I had to hit stop through IDL but even that
took a while and made my computer go very slow.
I was just wondering if this is a bug that I encountered. I did
download your library 2 days ago but I know you're making
updates. Thanks!
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: IDL 8 NG widget problem
Next Topic: IDL 8 NG widget problem

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

Current Time: Wed Oct 08 15:17:42 PDT 2025

Total time taken to generate the page: 0.00691 seconds