[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: plot axis colors

Dave Avis (davis@virtuallythere.net ) writes: 

> When using colortables (the built-in ones) with a plot, sometimes the axis
> color causes the axis and labels to disappear.  I figure that it is because
> the axis and the labels are set to a particular element of the color table
> and that element is the same color as the background color of the plot
> window.  How would I go about changing this without editing the color table?
> If I have to edit the color table, which element is the one that the axis
> and labels use, or how can I find out?  I have this problem on the color
> table named either "prism" or "spectrum".

The plotting color is set in !P.Color, while the background
color is set in !P.Background. Normally, these colors are
assigned to the top and bottom of the color table, 
respectively. With the Prism color table color index
0 and color index !D.Table_Size-1 are both set to
a black color. Hence, you draw black on black plots.
Not too good for viewing. :-)

I like to load "drawing" colors at the top of my
color table and have "data" colors below. For
example, I will do something like this:

   Device, Decomposed=0
   white = GetColor("white", !D.Table_Size-1)
   navy = GetColor("navy", !D.Table_Size-2)
   imgColors = !D.Table_Size-2
   LoadCT, 5, NColors=imgColors
   !P.Color = navy
   Plot, Findgen(11)
   TVImage, BytScl(image, Top=imgColors-1), /Multi

To change image colors, I do this:

   XLoadCT, NColors=imgColors

Of course, you will need my GetColor and TVImage programs
to run this code. :-)



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