Re: ps_start and color [message #80251] |
Fri, 25 May 2012 09:26  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
simona bellavista writes:
>
>> Unless you are using an ancient version of the Coyote
>> Library, I don't see any way this doesn't produce
>> a red line. In fact, I don't see any possibility
>> that it doesn't produce a red line in PostScript.
>
> I downloaded the last version of the coyote library just before posting here.
>
>> So, I guess the question is. What makes you think
>> it doesn't?
>
> experimenting. It doen't work, not on my system at least.
>
> my system is linux
> the exact code I used is the following and I run it like a script:
>
> ps=1
> datacolor=cgcolor("Red",!D.table_size-4)
> filename ='~/idl/test.eps'
>
> if (ps eq 1) then ps_start, file = filename
> if (ps ne 1) then begin $
> & set_plot, 'x' $
> & window, 0, retain = 2 $
> & endif
>
> N=100
> sp = dindgen(N)
> vector1 = replicate(0.5,N)
> vector2 = replicate(0.6,N)
>
> multiplot,[1,2]
> plot, sp, vector1, xstyle=1, yr=[0,1]
> oplot, sp, vector2,color=datacolor
>
> multiplot
> plot, sp, vector1, xstyle=1, yr=[0,1]
> oplot, sp, vector2,color=datacolor
>
> multiplot,/reset
> if (ps eq 1) then ps_end
Ah, well, that's not the code you sent before. In the
code we were testing, you loaded the color AFTER you
ran PS_START. If you do it *before* you run PS_START
there is a possibility the color will be wrong, depending
upon how your machine is set up.
There would be no confusion if you specified the color
on the command line that used the color, or (a MUCH better
solution!) you used Coyote Graphics commands to draw your
graphics.
But, in your case, just moving the color definition to
after the PS_Start command will solve your problem.
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 #80252 is a reply to message #80251] |
Fri, 25 May 2012 08:52   |
simona bellavista
Messages: 56 Registered: December 2009
|
Member |
|
|
> Unless you are using an ancient version of the Coyote
> Library, I don't see any way this doesn't produce
> a red line. In fact, I don't see any possibility
> that it doesn't produce a red line in PostScript.
I downloaded the last version of the coyote library just before posting here.
> So, I guess the question is. What makes you think
> it doesn't?
experimenting. It doen't work, not on my system at least.
my system is linux
the exact code I used is the following and I run it like a script:
ps=1
datacolor=cgcolor("Red",!D.table_size-4)
filename ='~/idl/test.eps'
if (ps eq 1) then ps_start, file = filename
if (ps ne 1) then begin $
& set_plot, 'x' $
& window, 0, retain = 2 $
& endif
N=100
sp = dindgen(N)
vector1 = replicate(0.5,N)
vector2 = replicate(0.6,N)
multiplot,[1,2]
plot, sp, vector1, xstyle=1, yr=[0,1]
oplot, sp, vector2,color=datacolor
multiplot
plot, sp, vector1, xstyle=1, yr=[0,1]
oplot, sp, vector2,color=datacolor
multiplot,/reset
if (ps eq 1) then ps_end
|
|
|
|
|
|
|
|
Re: ps_start and color [message #80258 is a reply to message #80252] |
Fri, 25 May 2012 08:43   |
wlandsman
Messages: 743 Registered: June 2000
|
Senior Member |
|
|
You are using Coyote graphics for some commands but not others. Try changing your PLOT calls to CGPLOT, and OPLOT calls to CGPLOT,/OVER
--Wayne
On Friday, May 25, 2012 11:28:38 AM UTC-4, simona bellavista wrote:
> 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 #80259 is a reply to message #80258] |
Fri, 25 May 2012 08:38   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
simona bellavista writes:
> 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?
Unless you are using an ancient version of the Coyote
Library, I don't see any way this doesn't produce
a red line. In fact, I don't see any possibility
that it doesn't produce a red line in PostScript.
So, I guess the question is. What makes you think
it doesn't?
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 #80349 is a reply to message #80251] |
Fri, 25 May 2012 09:56  |
simona bellavista
Messages: 56 Registered: December 2009
|
Member |
|
|
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 ??
> Ah, well, that's not the code you sent before. In the
> code we were testing, you loaded the color AFTER you
> ran PS_START. If you do it *before* you run PS_START
> there is a possibility the color will be wrong, depending
> upon how your machine is set up.
>
> There would be no confusion if you specified the color
> on the command line that used the color, or (a MUCH better
> solution!) you used Coyote Graphics commands to draw your
> graphics.
>
> But, in your case, just moving the color definition to
> after the PS_Start command will solve your problem.
>
|
|
|
Re: ps_start and color [message #80350 is a reply to message #80253] |
Fri, 25 May 2012 09:26  |
simona bellavista
Messages: 56 Registered: December 2009
|
Member |
|
|
evince always shows the colors
I also visualize it with ghostscript:
gs -dSAFER -dBATCH -sDEVICE=x11
and tried to convert it to png with convert. it is always black.
On 25 Mag, 18:15, David Fanning <n...@idlcoyote.com> wrote:
> simona bellavista writes:
>> Well, I am visualising it with evince and it is black.
>
> Well, I don't know evince. But I would say either color
> is not turned on in that program, or it is displaying
> the wrong thing. The line is red, I can assure you
> of that. :-)
>
> Do you have a GhostScript viewer (perhaps "gv" in Linux)?
>
|
|
|