Skip to content

Scale_*_viridis_b not using full width of palette #4372

Closed
@gregleleu

Description

@gregleleu

When using scale_(fill/colour)_viridis_b, the colors don't go all the way to the end of the palette, i.e. very-yellow yellow).
Is it intended to do that? How to change this behavior if it is?

library(ggplot2)

ggplot(data = ggplot2::diamonds) +
  geom_bar(aes(x = cut, fill = depth, group = depth)) +
  scale_fill_viridis_b(n.breaks = 4)

image

scales::show_col(
  viridis::viridis_pal()(4)
)

Full palette (4 steps)
image

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions