davidhodge931 / ggblanket

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

docs: col defaults for ordered variables #947

Open davidhodge931 opened 2 weeks ago

davidhodge931 commented 2 weeks ago
library(tidyverse)
library(ggblanket)

set_blanket()

diamonds |> 
  slice_sample(prop = 0.01) |> 
  gg_point(
    x = carat, 
    y = price,
    col = cut,
  )

diamonds |> 
  slice_sample(prop = 0.01) |> 
  mutate(cut = factor(cut, ordered = FALSE)) |> 
  gg_point(
   x = carat, 
   y = price,
   col = cut,
  )

diamonds |> 
  slice_sample(prop = 0.01) |> 
  gg_point(
    x = carat, 
    y = price,
    col = cut,
    col_palette = jumble,
    col_legend_rev = TRUE,
  )