Skip to content

Could support the use of function factories like scales::pal_hue() and scales::pal_viridis()? #5843

Closed
@davidhodge931

Description

@davidhodge931

It'd be great if it was possible to do this for all of the non-positional scales, especially colour/fill

library(tidyverse)
library(palmerpenguins)

penguins |>
  ggplot() +
  geom_point(aes(x = flipper_length_mm,
                 y = body_mass_g,
                 col = species)) +
  scale_colour_manual(values = scales::pal_hue())

penguins |>
  ggplot() +
  geom_point(aes(x = flipper_length_mm,
                 y = body_mass_g,
                 col = bill_depth_mm)) +
  scale_colour_gradientn(colours = scales::pal_viridis())

penguins |>
  ggplot() +
  geom_point(aes(x = flipper_length_mm,
                 y = body_mass_g,
                 col = bill_depth_mm)) +
  scale_colour_stepsn(colours = scales::pal_viridis())

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions