On 2026-04-28 4:11 a.m., Stefano Sofia via R-help wrote:> Deer R-list users,
>
> I need to create multiple plots per page, without using ggplot.
>
> Let's say that I want two plots per page, 3 pages.
>
>
> png(file="test.png", units="cm", res=200, width=19,
height=24)
>
> par(mfrow=c(2,1))
>
> for(ii in 1:3){
>
> plot(ii,ii)
>
> hist(rnorm(10))
>
> }
>
> dev.off()
>
>
> overwrites the first two pages and creates only the third one.
>
>
> pdf(file="test.pdf")
>
> ...
>
>
> works fine, but I would like to stick to the png command. Is there a way to
do it?
You can't have multiple pages in a single .png file, but R will create
multiple .png files if you use a filename like "test%03d.png" (where
the
"%03d" suffix is a C-style format spec).
Duncan Murdoch>
> Thank you for your help
>
> Stefano Sofia
>
>
>
> (oo)
> --oOO--( )--OOo--------------------------------------
> Stefano Sofia MSc, PhD
> Civil Protection Department - Marche Region - Italy
> Meteo Section
> Snow Section
> Via Colle Ameno 5
> 60126 Torrette di Ancona, Ancona (AN)
> Uff: +39 071 806 7743
> E-mail: stefano.sofia at regione.marche.it
> ---Oo---------oO----------------------------------------
>
> ________________________________
>
> AVVISO IMPORTANTE: Questo messaggio di posta elettronica pu? contenere
informazioni confidenziali, pertanto ? destinato solo a persone autorizzate alla
ricezione. I messaggi di posta elettronica per i client di Regione Marche
possono contenere informazioni confidenziali e con privilegi legali. Se non si ?
il destinatario specificato, non leggere, copiare, inoltrare o archiviare questo
messaggio. Se si ? ricevuto questo messaggio per errore, inoltrarlo al mittente
ed eliminarlo completamente dal sistema del proprio computer. Ai sensi
dell'art. Ai sensi dell'art. 2.4 dell'allegato 1 alla DGR n.
74/2021, si segnala che, in caso di necessit? ed urgenza, la risposta al
presente messaggio di posta elettronica pu? essere visionata da persone estranee
al destinatario.
> IMPORTANT NOTICE: This e-mail message is intended to be received only by
persons entitled to receive the confidential information it may contain. E-mail
messages to clients of Regione Marche may contain information that is
confidential and legally privileged. Please do not read, copy, forward, or store
this message unless you are an intended recipient of it. If you have received
this message in error, please forward it to the sender and delete it completely
from your computer system.
>
> [[alternative HTML version deleted]]
>
>
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
https://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.