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

Home » Public Forums » archive » simple, yet eluding...different color lines in a plot
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
simple, yet eluding...different color lines in a plot [message #12836] Fri, 18 September 1998 00:00 Go to next message
T Bowers is currently offline  T Bowers
Messages: 56
Registered: May 1998
Member
how do i oplot so that different data get assigned different colors, eg.

plot,x,a
;a should be red curve
oplot,x,b
;b should be green curve
oplot,x,c
;c should be blue curve

thanks
Re: simple, yet eluding...different color lines in a plot [message #12930 is a reply to message #12836] Thu, 24 September 1998 00:00 Go to previous messageGo to next message
T Bowers is currently offline  T Bowers
Messages: 56
Registered: May 1998
Member
hmmmm... doesn't work.
plot,x,a, color=1 ;gives me a red line
oplot,x,b, color=2 ;= black line
oplot,x,b, color=3 ; = black line

strange, i seem to ONLY get red or black colors if i try
to specify a color. i tried tek_color 1st and the docs say:

The TEK_COLOR procedure loads a 32-color colortable similar to the default
Tektronix 4115 colortable. This colortable is useful because of its distinct
colors.
By default, this palette consists of 32 colors. The first 9 colors are:
Index 0=black, 1=white, 2=red, 3=green, 4=blue, 5=cyan, 6=magenta, 8=orange.

if I :
TEK_COLOR
plot,x,a, color=0
oplot, x,b,color=1
oplot, x,c,color=2
oplot, x,d,color=3
oplot, x,e,color=4
oplot, x,f

IDL plots a black, b red, c red, d black, and e black., f, with no color
designation, is white.

certainly not the black, white, red, green, blue that tek_color is supposed
to plot. seems like I only get red or black, no matter what my color index
is.

this is *really* confusing me.

what's causing this??
if i go to the demo dir and run an idl sample with colors, it runs fine.
then
i run mine and again i get black, red, and white only. this is driving me
nuts!

thaks,
todd

Vap User wrote in message <88u324gdbw.fsf@haifung.jpl.nasa.gov>...
> "T Bowers" <tbowers@nrlssc.navy.mil> writes:
>
> Assuming you are running with a 8 bit system and that you have at
> least 5 color slots available.
>
> Tvlct, [ 0, 255,0,0,255], [0, 0,255,0,255], [0, 0,0,255,255], 0
> plot,x,a, color=1
> oplot,x,b, color=2
> oplot,x,c, color=3
>
> See Dave Fannings Website for how to do it in 24 bits.
(http://www.dfanning.com)
> I don't mess with 24 bits myself.
>
> whd
>
>>
>> how do i oplot so that different data get assigned different colors, eg.
>>
>> plot,x,a
>> ;a should be red curve
>> oplot,x,b
>> ;b should be green curve
>> oplot,x,c
>> ;c should be blue curve
>>
>> thanks
>>
>>
>
> --
> I don't speak for JPL, it doesn't speak for me.
> Well, not all the time, at least.
> William Daffer <vapuser@haifung.jpl.nasa.gov>
Re: simple, yet eluding...different color lines in a plot [message #12973 is a reply to message #12836] Sat, 19 September 1998 00:00 Go to previous messageGo to next message
Vap User is currently offline  Vap User
Messages: 31
Registered: April 1998
Member
"T Bowers" <tbowers@nrlssc.navy.mil> writes:

Assuming you are running with a 8 bit system and that you have at
least 5 color slots available.

Tvlct, [ 0, 255,0,0,255], [0, 0,255,0,255], [0, 0,0,255,255], 0
plot,x,a, color=1
oplot,x,b, color=2
oplot,x,c, color=3

See Dave Fannings Website for how to do it in 24 bits. (http://www.dfanning.com)
I don't mess with 24 bits myself.

whd

>
> how do i oplot so that different data get assigned different colors, eg.
>
> plot,x,a
> ;a should be red curve
> oplot,x,b
> ;b should be green curve
> oplot,x,c
> ;c should be blue curve
>
> thanks
>
>

--
I don't speak for JPL, it doesn't speak for me.
Well, not all the time, at least.
William Daffer <vapuser@haifung.jpl.nasa.gov>
Re: simple, yet eluding...different color lines in a plot [message #13002 is a reply to message #12836] Sun, 27 September 1998 00:00 Go to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Phillip & Suzanne David (pdavid@earthling.net) writes:

> It appears to me that you are running in 16 or 24 bit color. When in this
> mode, colors come up as shades of red rather than the proper shades unless
> you've properly set the decomposed option. I don't recall the exact setting,
> but that might help.

Yes. As it happens Todd was running a new version of IDL
(IDL 5.1) in a 24-bit Windows environment. A simple:

Device, Decomposed=0

sorted him out.

I've added yet more articles on my web page to alert users
to this potential problem. :-)

Cheers,

David

----------------------------------------------------------
David Fanning, Ph.D.
Fanning Software Consulting
E-Mail: davidf@dfanning.com
Phone: 970-221-0438, Toll-Free Book Orders: 1-888-461-0155
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Re: simple, yet eluding...different color lines in a plot [message #13003 is a reply to message #12836] Sun, 27 September 1998 00:00 Go to previous message
Phillip &amp; Suzanne is currently offline  Phillip &amp; Suzanne
Messages: 31
Registered: June 1998
Member
It appears to me that you are running in 16 or 24 bit color. When in this
mode, colors come up as shades of red rather than the proper shades unless
you've properly set the decomposed option. I don't recall the exact setting,
but that might help.

Phillip David

T Bowers wrote:

> hmmmm... doesn't work.
> plot,x,a, color=1 ;gives me a red line
> oplot,x,b, color=2 ;= black line
> oplot,x,b, color=3 ; = black line

> strange, i seem to ONLY get red or black colors if i try
> to specify a color. i tried tek_color 1st and the docs say:
Re: simple, yet eluding...different color lines in a plot [message #13027 is a reply to message #12836] Thu, 24 September 1998 00:00 Go to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
T Bowers (tbowers@nrlssc.navy.mil) writes:

> hmmmm... doesn't work.
> plot,x,a, color=1 ;gives me a red line
> oplot,x,b, color=2 ;= black line
> oplot,x,b, color=3 ; = black line
>
> strange, i seem to ONLY get red or black colors if i try
> to specify a color. i tried tek_color 1st and the docs say:

Todd, you have something *seriously* wrong with your IDL
session. I suspect you have Netscape running. :-)

You are just plain out of colors. Try this:

(1) Open an IDL session.
(2) Type: Window
(3) Now type: Print, !D.N_Colors

You should have *at least* 150 or so. If you don't, try
closing all the other applications you have running before
you start IDL. Same thing? Then I suspect something has
gone wrong in one of your startup files.

(4) Do steps 1 and 2, then type:

Help, /Device

What kind of visual class to you have? How many colors?
We definitely need more clues to get this puppy hunting. :-)

All else fails, try this:

(1) Open an IDL session.
(2) Type: Window, Colors=240
(3) Now type: Print, !D.N_Colors
(4) Now type: Help, /Device

Do you have a private color table? Yes? But you have
240 colors, no? Can you live with color flashing? :-)

Cheers,

David

----------------------------------------------------------
David Fanning, Ph.D.
Fanning Software Consulting
E-Mail: davidf@dfanning.com
Phone: 970-221-0438, Toll-Free Book Orders: 1-888-461-0155
Coyote's Guide to IDL Programming: http://www.dfanning.com/
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Multithreaded external routines for IDL/WinNT
Next Topic: Contributed Source: CW_selectaxes (Corrected and working!)

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

Current Time: Fri Oct 10 01:58:17 PDT 2025

Total time taken to generate the page: 1.04343 seconds