I set five breaks and 5 labels in scale_color_continuous(breaks = c(1,2,3,4,5), labels = c("one", "two", "three", "four", "Five")). It is working well for two breaks and labels. However, when a breaks and labels is reduced to one by filtering , it says Breaks and labels are different lengths.
library(tidyverse)
mtcars1 <- mtcars %>% filter(gear == 5)
ggplot(mtcars1, aes(wt, mpg)) + geom_point(aes(color = gear)) + scale_color_continuous(breaks = c(1,2,3,4,5), labels = c("one", "two", "three", "four", "Five"))