Hi, please help me
I want to add manual label names on the color bar just like this --- labels = c("Low", 5, 10, 25, 60, "High"). In simple, I want to add text for Low and High values at the bottom and top of the scale bar (at the side of 0 and 100). How can I add this? Please, help me
x <- 1:100
y <- runif(100) * 100
tib <- tibble(x, y)
ggplot(tib, aes(x = x, y = y, color = y)) +
geom_point() +
binned_scale(aesthetics = "color",
scale_name = "stepsn",
palette = function(x) c("red", "yellow", "green", "yellow", "red"),
breaks = c(0, 5, 10, 25, 60, 100),
limits = c(0, 100),
show.limits = TRUE,
guide = "colorsteps"
)
Like this---
I tried to adding--- labels = c("Low", 5, 10, 25, 60, "High") in the script but it showed the error====
Error in f()
:
! Breaks and labels are different lengths
Run rlang::last_error()
to see where the error occurred.