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

Home » Public Forums » archive » Re: plot axis colors
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: plot axis colors [message #17484] Thu, 21 October 1999 00:00
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
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
!P.Background=white

!P.Multi=[0,1,2]
Plot, Findgen(11)
TVImage, BytScl(image, Top=imgColors-1), /Multi
!P.Multi=0

To change image colors, I do this:

XLoadCT, NColors=imgColors

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

http://www.dfanning.com/documents/programs.html

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: plot axis colors [message #17485 is a reply to message #17484] Thu, 21 October 1999 00:00 Go to previous message
Pavel Romashkin is currently offline  Pavel Romashkin
Messages: 166
Registered: April 1999
Senior Member
Use COLOR=x and BACKGROUND=y when you issue your plotting commands. If you are
plotting to an indexed-color device and the number of available colors varies,
you may find that colors change on your plots. However, you will always see the
axes as long as X ne Y.

Cheers,
Pavel

Dave Avis wrote:

> 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" (sorry, don't remember the number
> offhand).
>
> Dave
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: callable IDL error handling
Next Topic: plot axis colors

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

Current Time: Wed Oct 08 19:45:59 PDT 2025

Total time taken to generate the page: 0.00551 seconds