Question

Below is my code, I just want the Y axis ticks to be in 5% increments, there are too many ticks, because they correspond to each plot.

library(ggplot2)
ggplot(data = data, aes(x = X, y = Y,  label = Label)) + 
  geom_point() + 
  scale_colour_manual(values = c("steelblue4", "chartreuse4", "gold", "firebrick2")) +
  geom_text(aes(color = Goal), position = "jitter", hjust=0.5, vjust=1.1, size = 2.3) +
  labs(title = "Google", x = "Correlation Coefficient", y = "Top-Box %")
Was it helpful?

Solution

Try adding this layer to your ggplot:

scale_y_continuous(breaks=seq(min(data$Y),max(data$Y),(max(data$Y)-min(data$Y))/20))

The breaks= argument takes a vector that allows you to manually specify the breaks. To get 20 equally spaced values from the lowest to highest values in data$Y the seq function comes in handy. You could also wrap the seq() function with round() function to clean up the potentially messy numbers that result from max()-min()/20.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top