Re: drawing color_bar at the right sides of maps [message #14457] |
Wed, 03 March 1999 00:00 |
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
|
|
|
|