How to force ggplot2 to show axis tick labels smaller than 10^-100 on log-scale axis?

问题描述 投票:0回答:0

我需要在图上显示具有极小值的点,即小于 10^-100。不幸的是,'ggplot' 停止显示该值的刻度标签。例如

library(ggplot2)
data <- data.frame(x =10^-(seq(0,250,by=20)),y= 10^-(seq(250,0,by=-20)))
ggplot(data,aes(x,y))+
  geom_point()+
  scale_x_log10(labels = trans_format("log10", math_format(10^.x)),
                limits = c(10^-300,1),
                breaks = 10^(seq(-300,0,by = 20)))+
  scale_y_log10(labels = trans_format("log10", math_format(10^.x)),
                limits = c(10^-300,1),
                breaks = 10^(seq(-300,0,by = 20)))+
  theme_classic()

结果如下图: Tick labels end at 10^-100

如你所见,我尝试设置限制,并手动设置刻度(

brakes
选项)。虽然没有效果。谷歌搜索和 SO 搜索都没有答案。

r ggplot2 axis-labels
© www.soinside.com 2019 - 2024. All rights reserved.