ggplot R scale x log10限制不起作用

时间:2015-06-23 13:13:06

标签: r ggplot2 scale

我在数据框q中有变量t我希望limit x_axis log10 scale

#t$q
1.000000 2.500000 2.733333 3.032258 1.545455 1.967213 1.176471 1.000000 2.533333 3.136364 1.967213
ggplot(t,aes(x=q))+geom_freqpoly(binwidth=0.1)+scale_x_log10(limits=c(0,1))+scale_y_log10()

我收到了这个错误:

Error in if (diff(range) == 0) { : missing value where TRUE/FALSE needed
Error in exists(name, envir = env, mode = mode) : 
  argument "env" is missing, with no default

怎么了?

1 个答案:

答案 0 :(得分:3)

0的对数是负无穷大,所以你有一个非常长的x轴!请在limits=c(0.1, 1)来电中尝试ggplot