本文介绍了ggplot2:log10标度和轴限制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
基本上这样的问题:我希望限制在图的边缘和0个额外的空间。如何做到这一点?
解决方案
ggplot(data = df,aes(x = x,y = y))+
geom_point()+
scale_y_log10(limits = c(1,1e8),expand = c(0,0))
Basically like this question:
How can I set axis ranges in ggplot2 when using a log scale?
The issue I have with the solution and ggplot2 it seems that it overdraws. I want limits = c(1,1e8)
I do not want the tiny bit additional space below and above this limits. See below:
I want the limits to be at the edge of the graph and 0 additional space. How do I achieve that?
解决方案
ggplot(data = df,aes(x = x, y =y)) +
geom_point() +
scale_y_log10(limits = c(1,1e8), expand = c(0, 0))
这篇关于ggplot2:log10标度和轴限制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!