# North American mammal sizes from Brown & Maurer (1989) install.packages('circlize') library('circlize') num_genera<-c(2,27,70,117,113,84,75,81,52,47,26,18,7,4) n<-length(num_genera) m<-cumsum(num_genera) x<-360*m/sum(num_genera) x<-c(0,x) log_body_mass_base2<-c(1:14) plot(NULL,xlim=c(-8,15),ylim=c(-12,12),axes=F, ann=F, type = "n", xlab="",ylab="") #set up a blank plot area with size based on max mass (log base 2) for (i in 1:n){ draw.sector(start.degree = x[i], end.degree = x[i+1], rou1 = 0, rou2 = log_body_mass_base2[i], center = c(0, 0), clock.wise = FALSE, col=gray(1-(0.1+(0.9*num_genera[i]/max(num_genera)))), border = "black", lwd = 1, lty =0) } for (i in 1:n){ draw.sector(start.degree = x[i], end.degree = x[i+1], rou1 = 0, rou2 = log_body_mass_base2[i], center = c(0, 0), clock.wise = FALSE, col=heat.colors(100, 0.1+(0.9*num_genera[i]/max(num_genera))), border = "black", lwd = 1, lty =0) } for (i in 1:n){ draw.sector(start.degree = x[i], end.degree = x[i+1], rou1 = 0, rou2 = log_body_mass_base2[i], center = c(0, 0), clock.wise = FALSE, col=terrain.colors(100, 0.1+(0.9*num_genera[i]/max(num_genera))), border = "black", lwd = 1, lty =0) } for (i in 1:n){ draw.sector(start.degree = x[i], end.degree = x[i+1], rou1 = 0, rou2 = log_body_mass_base2[i], center = c(0, 0), clock.wise = FALSE, col=rainbow(256,1)[round(256*(0.1+(0.9*num_genera[i]/max(num_genera))))], border = "black", lwd = 1, lty =0) }