Y轴不够长(对数刻度)

时间:2017-12-01 22:19:41

标签: r logging scale

您好, 我想要一个视觉上令人愉悦的Y轴

counts=c(Low = 3553, Mid = 203, High = 3158, Low = 13, Mid = NA, High = NA,Low = 16, Mid = 14, High = NA,Low = 1, Mid = 7, High = 21)
barplot(counts,log="y",ylab="Total counts from quadrats (Log scale)",axes=F)
axis(2, 0:4000)

enter image description here 从结果中可以看出,事情变得有些混乱。如果我做了轴= T,轴就会停在1000.

1 个答案:

答案 0 :(得分:1)

您可以在axis中指定刻度标记的位置。另外,适当更改ylim中的barplot

   counts=c(Low = 3553, Mid = 203, High = 3158, Low = 13, Mid = NA, 
        High = NA,Low = 16, Mid = 14, High = NA,Low = 1, Mid = 7, High = 21)

    barplot(counts,log="y",
            ylab="Total counts from quadrats (Log scale)",
            axes=F,
            ylim = c(1, 4096))

    axis(2, c(1, 8, 124, 4096))

enter image description here