ps_start and color [message #80260] |
Fri, 25 May 2012 08:28  |
simona bellavista
Messages: 56 Registered: December 2009
|
Member |
|
|
Hello,
I did a plot like that
ps_start, file=filename
datacolor1=cgcolor("Red",!D.table_size-4)
multiplot,[1,2]
plot, vector1, ytitle='F', xstyle=1
oplot, vector2, color=datacolor1
multiplot
plot, vector1, xtitle='v[km/s]', xstyle=1
oplot, vector2,color=datacolor1
multiplot,/reset
ps_end
but I cannot see the red line on the ps, while I can see when I use x.
How do I get color in ps?
thank you
|
|
|
Re: ps_start and color [message #80345 is a reply to message #80260] |
Fri, 25 May 2012 10:48  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
simona bellavista writes:
> OK, I solved everything using the cg commands!
> these colors look like a mess
Yes, colors can be a mess. One of the hardest
things to learn in IDL, certainly. You may
want to get a book. It would not be a mistake
to think that ALL of Coyote Graphics is devoted
to making sense of color! And you can read all
about it, in excruciating detail here:
http://www.idlcoyote.com/books/index.php
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|
|
Re: ps_start and color [message #80347 is a reply to message #80260] |
Fri, 25 May 2012 10:22  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
David Fanning writes:
> You want this:
>
> cgplot, sp, vector1, xstyle=1, yr=[0,1], /nodata
> cgplot, sp, vector1, color = 'red', /over
> cgplot, sp, vector2, color='blue', /over
Or, even more succinctly:
cgplot, sp, vector1, xstyle=1, yr=[0,1], color='red'
cgplot, sp, vector2, color='blue', /over
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|
Re: ps_start and color [message #80348 is a reply to message #80260] |
Fri, 25 May 2012 10:17  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
simona bellavista writes:
> Thank you very much, a stupid mistake.
> but now I want to have a line blue and one red and I do
>
> cgplot, sp, vector1, xstyle=1, yr=[0,1], /nodata
> cgplot, sp, vector1, color = datacolor1, /over
> cgplot, sp, vector2, color=datacolor2 , /over
>
> But I both line in datacolor1 ??
You want this:
cgplot, sp, vector1, xstyle=1, yr=[0,1], /nodata
cgplot, sp, vector1, color = 'red', /over
cgplot, sp, vector2, color='blue', /over
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|