multiple plots per page, multiple pages

Stefano Sofia via R-help <[email protected]> Tue, 28 Apr 2026 08:11:10 +0000
Newsgroups gmane.comp.lang.r.general
Message-ID <[email protected]>
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?

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: [email protected]
---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]]