|
Re: Write graphics to two devices simultaneously? [message #66047 is a reply to message #66046] |
Mon, 13 April 2009 08:13  |
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 #66059 is a reply to message #66057] |
Sun, 12 April 2009 08:51  |
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  |
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.")
|
|
|