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

Home » Public Forums » archive » Re: drawing color_bar at the right sides of maps
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: drawing color_bar at the right sides of maps [message #14457] Wed, 03 March 1999 00:00
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Lee Hyun-Sook (hslee@astro.snu.ac.kr) writes:

> I know that my question is silly one, but it's hard for me to find out
> how to draw
> coloar bat at the right side of the map. Please, let me know how to or
> how can I
> find right help for drawing.

The trick is to leave some room on the right side of
the window for the colorbar. You can do this with the
POSITION keyword to the Map_Set command.

Then, just draw a colorbar. Since we seem to be talking
about objects today, here is an example program that uses a
colorbar object. You can download it at:

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

--
LoadCT, 5
Map_Set, /Ortho, /Grid, /Continent, $
Position = [0.1, 0.1, 0.7, 0.9], $
/Isotropic, /Label
cbar = Obj_New('Colorbar', $
Position = [0.85, !Y.Window[0], 0.90, !Y.Window[1]], $
Vertical = 1, $
Range = [0, 40], $
Title = 'Temperature')
cbar->Draw
END
--

Save the program as "example.pro". Then, run the program
as a main-level program, like this:

IDL> .Run example

Now, here is where you see the power of objects.
Don't want the color bar? Try this:

IDL> cbar->Erase

Want to see it again?

IDL> cbar->Draw

Ya gotta like that!

When you are done with the object, you get rid of it
like this:

IDL> Obj_Destroy, cbar

Have fun!

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
Re: drawing color_bar at the right sides of maps [message #14459 is a reply to message #14457] Wed, 03 March 1999 00:00 Go to previous message
Liam Gumley is currently offline  Liam Gumley
Messages: 473
Registered: November 1994
Senior Member
Lee Hyun-Sook wrote:
> I know that my question is silly one, but it's hard for me to find
> out how to draw
> coloar bat at the right side of the map. Please, let me know how to or
> how can I
> find right help for drawing.

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

---
Liam E. Gumley
Space Science and Engineering Center, UW-Madison
http://cimss.ssec.wisc.edu/~gumley
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Image Output Honors !P.Multi
Next Topic: Ohmygod, another round of column/row-major...

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

Current Time: Wed Oct 08 18:39:29 PDT 2025

Total time taken to generate the page: 0.00822 seconds