【发布时间】:2018-08-21 10:32:24
【问题描述】:
我有以下脚本:
testFigure <- ggplot(data = final_df, aes(x=final_df$`ng DNA`,
y=final_df$`count`)) +
geom_point(col = "darkmagenta") + ggtitle("ng VS Number") +
xlab(expression(paste("ng"))) + ylab("Num (#)") +
theme(plot.title = element_text(hjust = 0.5, color="orange", size=18,
face="bold.italic"),
axis.title.x = element_text(color="#993333", size=10, face = "bold"),
axis.title.y = element_text(color="#993333", size=10,face = "bold")) +
scale_y_log10(breaks=c(0,10,50,200,600))
testFigure+scale_x_continuous(breaks=c(5,50,100,150,200,250,300,350,400)
生成情节:
我想在 X 轴上分隔绘图区域,以便较低的值 0-10,尤其是 0-5,在它们之间更加清晰和间隔,同时保持其他的空间滴答声。
有什么建议吗?
【问题讨论】:
-
使用
scale_x_continuous()的trans参数怎么样?例如:data.frame(x=1:100,y=rnorm(100)) %>% ggplot(aes(x=x,y=y))+geom_point()+scale_x_continuous(trans="log10")