Did you know that you can navigate the posts by swiping left and right?

Multiple plots per page

29 Apr 2016 . category: R . Comments
#R #Plots

if you need to plot different figure on the same page use the following syntax.

my_mean<-30

par(mfrow=c(1,2))

plot(function(x) dnorm(x, my_ean, 15), -20, 80, ylab="Density", xlab="Size", col="dark green", lwd=2)

plot(function(x) dlnorm(x, log(my_mean), 1.5), 0, 80, ylab="Density", xlab="Size", col="blue", lwd=2)

mfrow will create one row with two columns.

each time you call plot R will use one of the available columns. So, in the previous example, R will plot a normal in the first column and a lognormal distribution in the second column.


Me

Sergio Vargas. Assistant professor at the LMU München. Working with octocorals, sponges and cyanobacteria.