Re: Two-page PostScript output [message #28704] |
Fri, 04 January 2002 09:29 |
David Shadovitz
Messages: 19 Registered: September 2000
|
Junior Member |
|
|
Good call, Bill!
I had tried to simplify the code shown in my snippet. The actual code (which I
inherited) doesn't call the Contour procedure directly. The code within the loop
over images actually looks like this:
; Keep the color bar from erasing the classifications
!P.NoErase = 1
VSPlot, info
!P.NoErase = 0
I did not realize that Erase or !P.NoErase would have an impact on the
pagination.
It's a pleasure learning from you all.
-David
William Thompson wrote:
> Paul van Delst <paul.vandelst@noaa.gov> writes:
>
>> David Shadovitz wrote:
>>>
>>> I'd be thrilled if anyone could help on this one...
>>>
>>> I'm trying to write a two-page PostScript file, with one image per
>>> page. The following code almost works; it writes both images
>>> superimposed on one page.
>>>
>>> Set_Plot, 'PS', /Copy
>>> Device, filename='C:\file1.ps'
>>> for iImage=0,1 do begin
>>> Contour, imageData(iImage), ...
>>> endfor
>>> Device, /Close
>
>> When I do things like the above, the graphics are on separate pages. Maybe
>> it's a windows thing.
>
>> IDL> print, !version
>> { x86 linux unix 5.4.1 Jan 16 2001 32 32}
>
> Most likely, David has !P.NOERASE set to something other than zero, for some
> reason. That's the only thing I can figure. The simplest solution is to set
> it back to !P.NOERASE=0. Explicitly calling ERASE, as has already been
> suggested, is another solution.
>
> Bill Thompson
|
|
|
Re: Two-page PostScript output [message #28712 is a reply to message #28704] |
Thu, 03 January 2002 14:53  |
thompson
Messages: 584 Registered: August 1991
|
Senior Member |
|
|
Paul van Delst <paul.vandelst@noaa.gov> writes:
> David Shadovitz wrote:
>>
>> I'd be thrilled if anyone could help on this one...
>>
>> I'm trying to write a two-page PostScript file, with one image per
>> page. The following code almost works; it writes both images
>> superimposed on one page.
>>
>> Set_Plot, 'PS', /Copy
>> Device, filename='C:\file1.ps'
>> for iImage=0,1 do begin
>> Contour, imageData(iImage), ...
>> endfor
>> Device, /Close
> When I do things like the above, the graphics are on separate pages. Maybe
> it's a windows thing.
> IDL> print, !version
> { x86 linux unix 5.4.1 Jan 16 2001 32 32}
Most likely, David has !P.NOERASE set to something other than zero, for some
reason. That's the only thing I can figure. The simplest solution is to set
it back to !P.NOERASE=0. Explicitly calling ERASE, as has already been
suggested, is another solution.
Bill Thompson
|
|
|
Re: Two-page PostScript output [message #28713 is a reply to message #28712] |
Thu, 03 January 2002 14:46  |
David Shadovitz
Messages: 19 Registered: September 2000
|
Junior Member |
|
|
That did it! Very intuitive!
Thank you Liam, Dave and Paul.
-David
"Liam E. Gumley" wrote:
> David Shadovitz wrote:
>> So, how do I put a page break into a PostScript file?
>
> Use the ERASE procedure. For example, the following creates a two page
> PS file:
>
> set_plot, 'PS'
> plot, indgen(10)
> erase
> contour, dist(32)
> device, /close
|
|
|
Re: Two-page PostScript output [message #28716 is a reply to message #28713] |
Thu, 03 January 2002 13:02  |
Dave Greenwood
Messages: 33 Registered: October 2000
|
Member |
|
|
David Shadovitz <david_shadovitz@xontech.com> wrote:
> I'd be thrilled if anyone could help on this one...
>
> I'm trying to write a two-page PostScript file, with one image per
> page. The following code almost works; it writes both images
> superimposed on one page.
>
> Set_Plot, 'PS', /Copy
> Device, filename='C:\file1.ps'
> for iImage=0,1 do begin
> Contour, imageData(iImage), ...
> endfor
> Device, /Close
>
> Device has an Output keyword which lets you specify device-specific
> commands, and thought that I could use that to force a page break. So I
> added this line right after the call to Contour:
>
> if (iImage eq 0) then Device, Output='{ gsave} { showpage} { grestore} {
> newpath}'
>
> I got those PS commands from a multi-page PS file created outside of
> IDL. But that did not work.
>
> So, how do I put a page break into a PostScript file?
Have you tried ERASE? My docs say it "starts a new page if the device
is a printer". I'd assume PostScript is a "printer". Don't know if RSI
makes the same assumption...
Dave
--------------
Dave Greenwood Email: Greenwoodde@ORNL.GOV
Oak Ridge National Lab %STD-W-DISCLAIMER, I only speak for myself
|
|
|
Re: Two-page PostScript output [message #28717 is a reply to message #28716] |
Thu, 03 January 2002 12:53  |
Liam E. Gumley
Messages: 378 Registered: January 2000
|
Senior Member |
|
|
David Shadovitz wrote:
> I'd be thrilled if anyone could help on this one...
>
> I'm trying to write a two-page PostScript file, with one image per
> page. The following code almost works; it writes both images
> superimposed on one page.
>
> Set_Plot, 'PS', /Copy
> Device, filename='C:\file1.ps'
> for iImage=0,1 do begin
> Contour, imageData(iImage), ...
> endfor
> Device, /Close
>
> Device has an Output keyword which lets you specify device-specific
> commands, and thought that I could use that to force a page break. So I
> added this line right after the call to Contour:
>
> if (iImage eq 0) then Device, Output='{ gsave} { showpage} { grestore} {
> newpath}'
>
> I got those PS commands from a multi-page PS file created outside of
> IDL. But that did not work.
>
> So, how do I put a page break into a PostScript file?
Use the ERASE procedure. For example, the following creates a two page
PS file:
set_plot, 'PS'
plot, indgen(10)
erase
contour, dist(32)
device, /close
Cheers,
Liam.
Practical IDL Programming
http://www.gumley.com/
|
|
|
Re: Two-page PostScript output [message #28718 is a reply to message #28717] |
Thu, 03 January 2002 12:54  |
Paul van Delst
Messages: 364 Registered: March 1997
|
Senior Member |
|
|
David Shadovitz wrote:
>
> I'd be thrilled if anyone could help on this one...
>
> I'm trying to write a two-page PostScript file, with one image per
> page. The following code almost works; it writes both images
> superimposed on one page.
>
> Set_Plot, 'PS', /Copy
> Device, filename='C:\file1.ps'
> for iImage=0,1 do begin
> Contour, imageData(iImage), ...
> endfor
> Device, /Close
When I do things like the above, the graphics are on separate pages. Maybe it's a windows
thing.
IDL> print, !version
{ x86 linux unix 5.4.1 Jan 16 2001 32 32}
paulv
--
Paul van Delst Religious and cultural
CIMSS @ NOAA/NCEP purity is a fundamentalist
Ph: (301)763-8000 x7274 fantasy
Fax:(301)763-8545 V.S.Naipaul
|
|
|