Skip to content
Prev 377505 / 398502 Next

[R studio] Plotting of line chart for each columns at 1 page

Hi

When I do multiple plots of similar data I usually put the plots into the multipage pdf file

pdf("somename.pdf")
for (i in columns) {
p<-ggplot(something)
print(p+geom_point(size=4)+stat_smooth(se=F, span=0.5, size=1.3)+
facet_grid(al2o3~teplota, labeller="label_both"))

or

plot(something)

}
dev.off()

This will generate somename.pdf in your working directory and plots will be definitelly bigger than 40 plots in one page.

Another approach could be to store plots as objects in a list (which is easy done with ggplot) but rather trickier with base graphics and make actual plotting after the whole list is populated with your plots.

https://www.andrewheiss.com/blog/2016/12/08/save-base-graphics-as-pseudo-objects-in-r/

Cheers
Petr
Osobn? ?daje: Informace o zpracov?n? a ochran? osobn?ch ?daj? obchodn?ch partner? PRECHEZA a.s. jsou zve?ejn?ny na: https://www.precheza.cz/zasady-ochrany-osobnich-udaju/ | Information about processing and protection of business partner?s personal data are available on website: https://www.precheza.cz/en/personal-data-protection-principles/
D?v?rnost: Tento e-mail a jak?koliv k n?mu p?ipojen? dokumenty jsou d?v?rn? a podl?haj? tomuto pr?vn? z?vazn?mu prohl??en? o vylou?en? odpov?dnosti: https://www.precheza.cz/01-dovetek/ | This email and any documents attached to it may be confidential and are subject to the legally binding disclaimer: https://www.precheza.cz/en/01-disclaimer/