Dear list, I'm stuck with a little graphical problem. I'm generating several lattice plots which are printed in a single postcript device opened by > trellis.device(postscript, theme=canonical.theme("postscript", color=F), file="an_phase2_graph.ps", paper="a4", pointsize = 10, onefile=TRUE, horizontal=TRUE) Everything works fine,but some of these plots shoud be printed in a portrait orientation to look better. I tried to include [...] par.settings = list(horizontal=FALSE) [...] in the lattice plots arguments, but with no success. Is there a way to mix different page orientation in a single postscript device that I missed ? -- Ir. Yves BROSTAUX Unit? de Statistique et Informatique Facult? universitaire des Sciences agronomiques de Gembloux (FUSAGx) 8, avenue de la Facult? B-5030 Gembloux Belgique T?l: +32 81 62 24 69 Email: brostaux.y at fsagx.ac.be
Prof Brian Ripley
2005-Jan-10 16:34 UTC
[R] Mixing portrait/landscape in a postscript file
On Mon, 10 Jan 2005, Yves Brostaux wrote:> Dear list, > > I'm stuck with a little graphical problem. I'm generating several lattice > plots which are printed in a single postcript device opened by > >> trellis.device(postscript, theme=canonical.theme("postscript", color=F), > file="an_phase2_graph.ps", paper="a4", pointsize = 10, onefile=TRUE, > horizontal=TRUE) > > Everything works fine,but some of these plots shoud be printed in a portrait > orientation to look better. I tried to include [...] par.settings = > list(horizontal=FALSE) [...] in the lattice plots arguments, but with no > success. Is there a way to mix different page orientation in a single > postscript device that I missed ?No. It is hard-coded in the header of the file. It is technically impossible in postscript, but what one could do is to rotate the coord system on individual pages so all the pages were portrait or landscape. I believe grid viewports can do that for you. -- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
On 10-Jan-05 Prof Brian Ripley wrote:> On Mon, 10 Jan 2005, Yves Brostaux wrote: >>> [...] >>> trellis.device(postscript, theme=canonical.theme("postscript", >>> color=F), >> file="an_phase2_graph.ps", paper="a4", pointsize = 10, onefile=TRUE, >> horizontal=TRUE) >> >> Everything works fine,but some of these plots shoud be printed >> in a portrait orientation to look better. I tried to include >> [...] par.settings = list(horizontal=FALSE) [...] in the lattice >> plots arguments, but with no success. Is there a way to mix >> different page orientation in a single postscript device that >> I missed ? > > No. It is hard-coded in the header of the file. > > It is technically impossible in postscript, but what one could do > is to rotate the coord system on individual pages so all the pages > were portrait or landscape. I believe grid viewports can do that > for you.Do you mean "tecnically impossible to achieve it directly using an R postscript device"? Because it is certainly possible to have a PostScript document in which some pages are portrait and some are landscape. And -- with appropriate DSC comments at the right places in the file -- these can be viewed correctly (i.e. the text always horizontal) using standard PS viewers; and they can be correctly converted to PDF to be viewed likewise. I could follow this up privately if anyone is interested: the details would not be appropriate for posting to the list! Best wishes to all, Ted. -------------------------------------------------------------------- E-Mail: (Ted Harding) <Ted.Harding at nessie.mcc.ac.uk> Fax-to-email: +44 (0)870 094 0861 [NB: New number!] Date: 10-Jan-05 Time: 20:07:55 ------------------------------ XFMail ------------------------------
Prof Brian Ripley
2005-Jan-10 21:34 UTC
[R] Mixing portrait/landscape in a postscript file
On Mon, 10 Jan 2005 Ted.Harding at nessie.mcc.ac.uk wrote:> On 10-Jan-05 Prof Brian Ripley wrote: >> On Mon, 10 Jan 2005, Yves Brostaux wrote: >>>> [...] >>>> trellis.device(postscript, theme=canonical.theme("postscript", >>>> color=F), >>> file="an_phase2_graph.ps", paper="a4", pointsize = 10, onefile=TRUE, >>> horizontal=TRUE) >>> >>> Everything works fine,but some of these plots shoud be printed >>> in a portrait orientation to look better. I tried to include >>> [...] par.settings = list(horizontal=FALSE) [...] in the lattice >>> plots arguments, but with no success. Is there a way to mix >>> different page orientation in a single postscript device that >>> I missed ? >> >> No. It is hard-coded in the header of the file. >> >> It is technically impossible in postscript, but what one could do >> is to rotate the coord system on individual pages so all the pages >> were portrait or landscape. I believe grid viewports can do that >> for you. > > Do you mean "tecnically impossible to achieve it directly using > an R postscript device"? Because it is certainly possible to have > a PostScript document in which some pages are portrait and some > are landscape. And -- with appropriate DSC comments at the right > places in the file -- these can be viewed correctly (i.e. the > text always horizontal) using standard PS viewers; and they can > be correctly converted to PDF to be viewed likewise.Yes (I used the name of the device, not the capitalized name of the language), because the orientation is set for the device, not the page.> I could follow this up privately if anyone is interested: the > details would not be appropriate for posting to the list!You could always work it out and supply a patch against the R-devel sources. There would need to be a way to specify the orientation of the current page, or probably the next page. -- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595