0

I simply want to add minor tick marks with no labels to my y-axis. One minor tick mark between each major tick mark. My y-axis already has major tick marks with labels (0,0.2).

d %>% mutate(variable = factor(d$variable, levels = c("Top1",   "Top2",   "Top3",   "Top4",   
"Top5",   "Sum_wd"), labels = c("1st (highest)", "2nd", "3rd", "4th", "5th (lowest)", 
"Treatment 5"))) %>% ggplot(aes(Year,value, col=variable)) + 
  geom_line()+
  geom_point()+
  scale_x_continuous("Year", labels = as.character(Year), breaks = Year)+
  theme(panel.grid.major = element_blank(), panel.grid.minor = 
element_blank(),panel.background = element_blank(), axis.line = element_line(colour = 
"black"),legend.position=c(.85,.75),text = element_text(size=20))+
  expand_limits(y=c(0,.20))+
  scale_y_continuous(breaks=seq(0,.20,.02))+
  ylab("Proportion")+
  scale_colour_brewer(palette="Dark2")+  labs(col = "Lobe size")
Ronak Shah
  • 377,200
  • 20
  • 156
  • 213
frog_dan
  • 13
  • 3
  • 1
    See also: https://teunbrand.github.io/ggh4x/articles/PositionGuides.html#minor-ticks-1 (disclaimer: I'm the author of that package). – teunbrand Mar 05 '21 at 18:49
  • @teunbrand thank you! I used minor_breaks and it worked the first time. Thank you for writing the package, extremely helpful. – frog_dan Mar 05 '21 at 19:17

0 Answers0