Hallo juniper,
schau mal, ob Dir das hier hilft:
Code: Alles auswählen
# Die ganzen Vorgaben mit Achsen und so verstecken wir in einer Funktion, die
# für das Zeichnen der Plots zuständig ist:
singleplot <- function(){
x <- as.Date(c("1970-03-03", "1974-03-27", "1995-06-13", "2009-05-05"))
y <- runif(4, 2, 110)
plot(x, y, xlim = as.Date(c("1970-01-01", "2022-01-01")) , ylim = c(120, 0), pch = 16)
abline(lm(y~x))
}
# einmal einen Plot zeichnen
singleplot()
# mehrere Plots mit einem Kommando zeichnen
par(mfrow= c(5,5), mar = c(1,1,1,1))
replicate(25, singleplot())
# ganz viele Plots auf die Festplatte schreiben (kann etwas dauern)
for(i in 1:1500){
png(paste0("Plot_", i, ".png"))
singleplot()
text(as.Date("1995-12-24"), 60, paste0(i), cex = 10, col = rgb(0, 0, 0, .3)) # bildindividuelle Ergänzung
dev.off()
}
# hier findet man dann hoffentlich die Bilddateien:
print(getwd())
LG,
Bernhard