[BioC] Script to save plots in Pdf format ( DNAcopy)

Kasper Daniel Hansen kasperdanielhansen at gmail.com
Wed Apr 6 15:45:04 CEST 2011


pdf() supports multiple pages so if you do

pdf(file = "tmp.pdf")
plot()
plot()
plot()
dev.off()

you'll get one pdf file with three pages.  Not all devices (example:
png()) support multiple pages.  Essentially, move the loop inside the
pdf() call in the two previous emails.

Kasper

On Wed, Apr 6, 2011 at 9:25 AM, Thomas Hampton
<thomas.h.hampton at dartmouth.edu> wrote:
> Here is an example of making 3 pdf  plots.
>
> It consists of a loop, marked off with curly brackets, executed for the
> variable i,
> which ranges from 1 to 3. The file names are 1.pdf, 2.pdf, and 3.pdf,
> generated using the  R paste function.
>
> The data are two sets of 10 random numbers, generated by rnorm.
>
> The pdf function creates the output, but in order for it to write out the
> final result, you need to call the dev.off function.
>
> for(i in 1:3){
>        pdf(file=paste(i,"pdf", sep='.'))
>        plot(rnorm(10), rnorm(10))
>        dev.off()
> }
>
>
> Best,
>
> Tom
> On Apr 6, 2011, at 6:45 AM, Nathalie Conte wrote:
>
>> dear All,
>> I am  using the DNA copy package to get my CGH files (Agilent 244K arrays)
>> analysed.
>> I am using this command to plot them one by one :
>> >plot(CNA.object, plot.type="w")
>> This is a very slow and time consuming process and I have ~60 files to
>> plot . I am quite novice in R and was wondering whether anybody could advise
>> on a simple script to get all files  plotted and the plots saved into a
>> single pdf file ( or nay other format)?
>> Many thanks in advance for any advice,
>>
>> Nathalie
>>
>>
>> --
>> The Wellcome Trust Sanger Institute is operated by Genome Research
>> Limited, a charity registered in England with number 1021457 and a company
>> registered in England with number 2742969, whose registered office is 215
>> Euston Road, London, NW1 2BE.
>>
>> _______________________________________________
>> Bioconductor mailing list
>> Bioconductor at r-project.org
>> https://stat.ethz.ch/mailman/listinfo/bioconductor
>> Search the archives:
>> http://news.gmane.org/gmane.science.biology.informatics.conductor
>
> _______________________________________________
> Bioconductor mailing list
> Bioconductor at r-project.org
> https://stat.ethz.ch/mailman/listinfo/bioconductor
> Search the archives:
> http://news.gmane.org/gmane.science.biology.informatics.conductor
>



More information about the Bioconductor mailing list