Creating a pdf with layers?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Creating a pdf with layers?

Christoph Scherber-2
Dear all,

Is it possible to create a pdf file with layers using the pdf() device in R?

Many thanks for your help!
Christoph


(using R 2.15.1 on Windows 7 64-Bit)



--
PD Dr Christoph Scherber
Georg-August University Goettingen
Department of Crop Science
Agroecology
Grisebachstrasse 6
D-37077 Goettingen
Germany
phone 0049 (0)551 39 8807
fax 0049 (0)551 39 8806
http://www.gwdg.de/~cscherb1

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Creating a pdf with layers?

Prof Brian Ripley
On 20/07/12 12:07, Christoph Scherber wrote:
> Dear all,
>
> Is it possible to create a pdf file with layers using the pdf() device in R?

No.  Is it possible to specify layers in the R graphics language or any
device?  (From what I understand by 'layers', no.)

The author of pdf()

>
> Many thanks for your help!
> Christoph
>
>
> (using R 2.15.1 on Windows 7 64-Bit)



--
Brian D. Ripley,                  [hidden email]
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

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Creating a pdf with layers?

Christoph Scherber-2
Dear Prof Ripley,

Many thanks for your response. In fact, latticeExtra and ggplot2 both state they work with "layers",
but essentially this is nothing more than sequentially adding graphical output to an existing device.

But given that PDF can include layers since version 1.5 it would be interesting to be able to divert
output to different layers inside a PDF structure.

Best regards
Christoph Scherber





Am 20.07.2012 13:48, schrieb Prof Brian Ripley:

> On 20/07/12 12:07, Christoph Scherber wrote:
>> Dear all,
>>
>> Is it possible to create a pdf file with layers using the pdf() device in R?
>
> No.  Is it possible to specify layers in the R graphics language or any
> device?  (From what I understand by 'layers', no.)
>
> The author of pdf()
>
>>
>> Many thanks for your help!
>> Christoph
>>
>>
>> (using R 2.15.1 on Windows 7 64-Bit)
>
>
>

--
PD Dr Christoph Scherber
Georg-August University Goettingen
Department of Crop Science
Agroecology
Grisebachstrasse 6
D-37077 Goettingen
Germany
phone 0049 (0)551 39 8807
fax 0049 (0)551 39 8806
http://www.gwdg.de/~cscherb1

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Creating a pdf with layers?

evanjbrunner
This post has NOT been accepted by the mailing list yet.
A patch for layers within the pdf() device.  

pdf("file/name", onepage=TRUE)
plot( … )           #layer 0
plot( … )           #layer 1
plot( … )           #layer 2
…                        …
dev.off()

Where the layer with the highest index is [on top / in the foreground] (0 is 'behind' 1 is 'behind' 2…).

This works as intended with v2.16.0 - it also updates the regression tests.  It doesn't seem to want to update the regression tests on v3.0.0, but everything else should work alright.

The regression tests fail after this update because I also patched the placement of the MediaBox attribute (it's typically found in the page dictionary, not in the pages tree) because I'd never seen it implemented as inheritable.   I should probably just take that out - then it'd work everywhere.

Anyway - here's this.  What should I do with it now - does anyone think this is worth more of my time?

ejb