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

Home » Public Forums » archive » Re: ps_start and color
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: ps_start and color [message #80251] Fri, 25 May 2012 09:26 Go to next message
David Fanning is currently offline  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 Go to previous messageGo to next message
simona bellavista is currently offline  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 #80253 is a reply to message #80252] Fri, 25 May 2012 09:15 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
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)?

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 #80254 is a reply to message #80252] Fri, 25 May 2012 09:11 Go to previous messageGo to next message
simona bellavista is currently offline  simona bellavista
Messages: 56
Registered: December 2009
Member
Well, I am visualising it with evince and it is black.

> Yes, but you are doing this in *PostScript*. Can you
> tell me *why* you thing it is not working? Are you
> viewing the file, printing it, what? What makes you
> think the line is black?
>
Re: ps_start and color [message #80255 is a reply to message #80252] Fri, 25 May 2012 09:09 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
simona bellavista writes:

> I downloaded the most recent version of the coyote library code before
> posting here.
> It looks to me like it doesn't work.
> Btw I am working on linux.

Yes, but you are doing this in *PostScript*. Can you
tell me *why* you thing it is not working? Are you
viewing the file, printing it, what? What makes you
think the line is black?

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 #80256 is a reply to message #80252] Fri, 25 May 2012 09:05 Go to previous messageGo to next message
simona bellavista is currently offline  simona bellavista
Messages: 56
Registered: December 2009
Member
I send a message previously, but I cannot see it...

I downloaded the most recent version of the coyote library code before
posting here.
It looks to me like it doesn't work.
Btw I am working on linux.

On 25 Mag, 17:38, David Fanning <n...@idlcoyote.com> wrote:
> 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
>
Re: ps_start and color [message #80257 is a reply to message #80252] Fri, 25 May 2012 09:03 Go to previous messageGo to next message
simona bellavista is currently offline  simona bellavista
Messages: 56
Registered: December 2009
Member
At least there is an improvement, now I can see the red line in the
plot, but it is black!

On 25 Mag, 17:43, wlandsman <wlands...@gmail.com> wrote:
> 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
>
Re: ps_start and color [message #80258 is a reply to message #80252] Fri, 25 May 2012 08:43 Go to previous messageGo to next message
wlandsman is currently offline  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 Go to previous messageGo to next message
David Fanning is currently offline  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 Go to previous message
simona bellavista is currently offline  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 Go to previous message
simona bellavista is currently offline  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)?
>
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Pan/Zoom Line Plots with Coyote Graphics
Next Topic: ps_start and color

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

Current Time: Wed Oct 08 19:15:37 PDT 2025

Total time taken to generate the page: 0.00645 seconds