【发布时间】:2014-12-08 21:25:19
【问题描述】:
我有这个代码来创建一个条形图,但我想将 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"))
【问题讨论】:
-
cex在我的经验中从来不是一个函数。