Re: IDL Colorbar generation question [message #49241 is a reply to message #49146] |
Tue, 04 July 2006 02:15   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
britneys@ucla.edu writes:
> I am attempting to add colorbars to my data plots. I have a set of
> self-defined colors that are used in my routine, saved to the standard
> R_CURR, G_CURR and B_CURR arrays. I had been trying to use either the
> IDLgrColorbar_define program or David Fanning's colorbar_define.
>
> Using IDLgrColorbar_define as prescribed:
>
> oColorbar =OBJ_NEW("IDLgrColorbar", [R_CURR, G_CURR, B_CURR],
> SHOW_AXIS=1, Title='values', HIDE=0)
>
> The colorbar is nowhere to be found in my window. Have I missed an
> element of the call?
Humm. These two colorbar routines belong to two completely
different graphics systems in IDL. These systems cannot be
combined with one another. I *presume* you are using the
direct graphics system (PLOT, CONTOUR, SURFACE, etc.)
If so, you will NEVER see IDLgrColorbar in your window, since it
uses the object graphic system.
Tell us what system you used to draw your plots, and we can advise
you more sensibly.
> Additionally, I am wondering two things about colorbar_define: 1) how
> can I use my self-defined color vectors in this routine (or can I?) 2)
> is there any change I should make so that the colorbar remains
> high-quality in a ps-output?
If you are talking about one of my colorbar routines, they both use
the colors loaded in the current color table. These are set with the
NCOLORS
and BOTTOM keywords, which are used in exactly the same way as
the same keywords for LOADCT. Nothing is *ever* required with my
direct graphics routines to get high-quality PS output. :-)
> Thanks in advance for any guidance, or suggestions of other ways I can
> make an easy color bar. Earlier topics have been helpful to progress
> but I've been unable to fix these specifics.
In general, for direct graphics output, something like this works
reasonably well:
Window
LoadCT, 33, NColors=16, Bottom=1
Colorbar, NColors=16, Bottom=1, Divisions=1, XTickLen=1
Cheers,
David
|
|
|