我有这段代码来创建条形图,但我想将 x 轴中的名称更改为物种名称,并且我想让字体变小,以便我可以将其全部放入。我尝试过使用cex 功能在各种组合中,但没有起作用。如果有建议我将不胜感激?
count <-
matrix(c(16,102,11,106,15,95,26,87,18,99,21,103,12,110,30,103,10,107,20,87,13,110,17,93), nrow = 2)
barplot(count, beside=T, legend =T, ylim=c(0,130),
col=c("darkolivegreen3", "firebrick1"),
ylab="Frequency (no. of moths)", las = 3,
names = c("tiger\nCo", "tiger\nCr" , "eyes\nCo", "eyes\nCr", "mottled\nCo","mottled\nCr", "pepperL\nCo","pepperL\nCr", "pepperD\nCo","pepperD\nCr", "convol\nCo", "convol\nCr"))
legend(6,130, legend=(c("survived","predated")), pch=c(15,22), cex=0.8, col=c("darkolivegreen3","firebrick1"))