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

Home » Public Forums » archive » Re: Write graphics to two devices simultaneously?
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: Write graphics to two devices simultaneously? [message #66046] Mon, 13 April 2009 08:18
stefan5465 is currently offline  stefan5465
Messages: 13
Registered: March 2009
Junior Member
Oh wait nevermind, I've found it...
Re: Write graphics to two devices simultaneously? [message #66047 is a reply to message #66046] Mon, 13 April 2009 08:13 Go to previous message
stefan5465 is currently offline  stefan5465
Messages: 13
Registered: March 2009
Junior Member
On Apr 12, 5:59 pm, David Fanning <n...@dfanning.com> wrote:
> stefan5...@hotmail.com writes:
>> David: can't believe I hadn't downloaded your library before! Going to
>> have a good nose around it...
>
> Yeah, it's always a shock to me that anyone can write
> IDL programs without it. ;-)
>
> Cheers,
>
> David
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming:http://www.dfanning.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")


Hi David,

I'm getting a '% Attempt to call undefined procedure/function:
'FSC_PS_SETUP__DEFINE'.'

when running PS_START.PRO, and a google search finds reference to it
only in PS_START.PRO; any idea what this means? I gather I need to
find and add this procedure to my path?

Cheers,

Stefan
Re: Write graphics to two devices simultaneously? [message #66055 is a reply to message #66047] Sun, 12 April 2009 09:59 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
stefan5465@hotmail.com writes:

> David: can't believe I hadn't downloaded your library before! Going to
> have a good nose around it...

Yeah, it's always a shock to me that anyone can write
IDL programs without it. ;-)

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: Write graphics to two devices simultaneously? [message #66057 is a reply to message #66055] Sun, 12 April 2009 09:43 Go to previous message
stefan5465 is currently offline  stefan5465
Messages: 13
Registered: March 2009
Junior Member
Thank you both, that's a nice solution! Very helpful cheers

David: can't believe I hadn't downloaded your library before! Going to
have a good nose around it...
Re: Write graphics to two devices simultaneously? [message #66059 is a reply to message #66057] Sun, 12 April 2009 08:51 Go to previous message
Jeremy Bailin is currently offline  Jeremy Bailin
Messages: 618
Registered: April 2008
Senior Member
On Apr 11, 11:08 am, David Fanning <n...@dfanning.com> wrote:
> stefan5...@hotmail.com writes:
>> Is there any way to print to an X11 window and simultaneously dump the
>> X11 output to a postscript file?
>
>> Of course, I could just copy paste the plot information for a new
>> device, but it would make the procedure annoyingly long. Is there a
>> command to take the contents of an X11 device and save it to the
>> postscript device, or a command to write to postscript at the same
>> time as X11?
>
> It is not possible to write to two graphics devices at
> the same time. But, well-written IDL graphics programs
> don't much care what device they are being written to,
> which allows you to use something like PS_START/PS_END
> to write them to PostScript files simply:
>
> Consider displaying a histogram of an image, using HISTOPLOT:
>
>    ; An image.
>    image = LoadData(7)
>
>    ; Write to display.
>    Histoplot, image, /FILL, POLYCOLOR='rose'
>
>    ; Write to PostScript file.
>    PS_START
>    Histoplot, image, /FILL, POLYCOLOR='rose'
>    PS_END
>
> Such commands work on Windows, LINUX, and Macintosh computers,
> and for Z-buffer and PRINTER devices, etc.
>
> Programs to help with this are found in the Coyote Library:
>
>   http://www.dfanning.com/programs/coyoteprograms.zip
>
> Cheers,
>
> David
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming:http://www.dfanning.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")

For cases like that, I tend to stick the entire thing into a for loop:

for ploti=0,1 do begin
if ploti eq 1 then ps_start
... insert plotting commands here
if ploti eq 1 then ps_end
endfor

That way you can ensure that your plot commands are absolutely
identical.

-Jeremy.
Re: Write graphics to two devices simultaneously? [message #66061 is a reply to message #66059] Sat, 11 April 2009 11:08 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
stefan5465@hotmail.com writes:

> Is there any way to print to an X11 window and simultaneously dump the
> X11 output to a postscript file?
>
> Of course, I could just copy paste the plot information for a new
> device, but it would make the procedure annoyingly long. Is there a
> command to take the contents of an X11 device and save it to the
> postscript device, or a command to write to postscript at the same
> time as X11?

It is not possible to write to two graphics devices at
the same time. But, well-written IDL graphics programs
don't much care what device they are being written to,
which allows you to use something like PS_START/PS_END
to write them to PostScript files simply:

Consider displaying a histogram of an image, using HISTOPLOT:

; An image.
image = LoadData(7)

; Write to display.
Histoplot, image, /FILL, POLYCOLOR='rose'

; Write to PostScript file.
PS_START
Histoplot, image, /FILL, POLYCOLOR='rose'
PS_END

Such commands work on Windows, LINUX, and Macintosh computers,
and for Z-buffer and PRINTER devices, etc.

Programs to help with this are found in the Coyote Library:

http://www.dfanning.com/programs/coyoteprograms.zip

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: What exactly does the command "strech" do to the colormap?
Next Topic: Reading ENVI evf files

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

Current Time: Fri Oct 10 16:33:24 PDT 2025

Total time taken to generate the page: 1.03970 seconds