小编Spo*_*ner的帖子

ggplot2 在标记的刻度线之间显示未标记的刻度线

我一直在我的直方图上显示小刻度线的问题。我尝试了绘制未标记的主要刻度线的想法,但不会显示刻度线。我的代码非常繁琐,可能有一些多余的行。任何帮助,将不胜感激。

ggplot(data=Shrimp1, aes(Shrimp1$Carapace.Length))+
geom_histogram(breaks=seq(3.5, 25, by=0.1),
             col="black",
             fill="gray", 
             alpha=1)+ 

 labs(title="Total Female Carapace Length")+
 labs(x="Carapace Length (mm)", y="# of Shrimp")+
  xlim(c(3.5, 25))+
  theme_bw()+
scale_y_continuous(expand = c(0,0),
                     limits = c(0,200))+
scale_x_continuous(breaks=seq(2.5,25,2.5))+

theme(axis.text.x=element_text(size=30,angle=45,hjust=1))+
  theme(plot.title=element_text(size=30, hjust=0.5))+
  theme(axis.text=element_text(size=30, color = "black"), 
        axis.title=element_text(size=30,face="bold"))+
  theme(panel.grid.major=element_line(colour="white"), 
        panel.grid.minor = element_line(colour = "white"))+
  theme(panel.border=element_blank())+
  theme(axis.ticks.x = (element_line(size=2)), 
        axis.ticks.y=(element_line(size=2)))+
  theme(axis.ticks.length=unit(.55, "cm"))+
  theme(panel.border=element_blank(), axis.line.x=element_line(colour="black"),
        axis.line.y=element_line(colour="black"))
Run Code Online (Sandbox Code Playgroud)

存在主要刻度,但我需要它们之间以 0.1 的间隔进行次要刻度

1

r histogram ggplot2

2
推荐指数
1
解决办法
3559
查看次数

标签 统计

ggplot2 ×1

histogram ×1

r ×1