davidhodge931 / ggblanket

Simplify ggplot2 visualisation
https://davidhodge931.github.io/ggblanket/
Other
150 stars 8 forks source link

weave_col_palette_d: if set with low numbers of elements, it doesn't work #885

Closed davidhodge931 closed 3 months ago

davidhodge931 commented 3 months ago
library(tidyverse)
library(palmerpenguins)
library(ggblanket)

set_blanket(
  col_palette_d = c('red', 'blue')
)

penguins |>
  mutate(across(sex, \(x) stringr::str_to_sentence(x))) |>
  gg_point(
    x = flipper_length_mm,
    y = body_mass_g,
    col = species,
    col_palette = jumble,
  )
#> Error in `palette()`:
#> ! Insufficient values in manual scale. 3 needed but only 2 provided.

Created on 2024-05-31 with reprex v2.1.0

davidhodge931 commented 3 months ago

Solution: paste na colour heaps of times onto set col_palette_d