-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Closed
Labels
bugan unexpected problem or unintended behavioran unexpected problem or unintended behaviorguides πscales π
Description
It always gives
Error in `check_breaks_labels()`:
! `breaks` and `labels` must have the same length
Reprex
library(tidyverse)
#works
mtcars %>%
ggplot(aes(hp, mpg, color = mpg)) +
geom_point() +
scale_color_stepsn(
colors = c("#dd3497",
"#ae017e",
"#7a0177",
"#49006a"),
breaks = c(15,20,25),
#labels = c("<15","15 text","20 text","25 text",">25")
)+
guides(color = guide_colorsteps(show.limits = TRUE))
#doesn't work
mtcars %>%
ggplot(aes(hp, mpg, color = mpg)) +
geom_point() +
scale_color_stepsn(
colors = c("#dd3497",
"#ae017e",
"#7a0177",
"#49006a"),
breaks = c(15,20,25),
labels = c("<15","15 text","20 text","25 text",">25")
)+
guides(color = guide_colorsteps(show.limits = TRUE))
#> Error in `check_breaks_labels()`:
#> ! `breaks` and `labels` must have the same length
Created on 2022-10-08 by the reprex package (v2.0.1)
davidhodge931 and llrs
Metadata
Metadata
Assignees
Labels
bugan unexpected problem or unintended behavioran unexpected problem or unintended behaviorguides πscales π