ggblanket icon indicating copy to clipboard operation
ggblanket copied to clipboard

colourbar/coloursteps: guide margins will not scale with text size

Open davidhodge931 opened this issue 1 year ago • 1 comments

Currrently, the margin of the margin in legend text for colourbar/coloursteps is added in a guide function in gg_blanket.

It should ideally be instead in the *_mode_* functions

However, ggplot2 does not currently provide seperate theme arguments for colourbar/colourstep guides

davidhodge931 avatar Feb 21 '24 04:02 davidhodge931

requires ggplot to make seperate theme elements for colourbar and coloursteps guides

davidhodge931 avatar Apr 03 '24 21:04 davidhodge931

  1. Update base mode code as below
  2. Remove special mode_* code that relates to these elements
  3. Remove from gg_blanket theme code
library(tidyverse)
library(palmerpenguins)

penguins |> 
  ggplot() +
  geom_point(aes(x = flipper_length_mm,
                 y = body_mass_g,
                 col = bill_depth_mm)) +
  light_mode_b() +
  theme(legend.text = element_text(margin = margin(5.5,5.5,5.5,5.5))) +
  theme(legend.key.spacing.x = grid::unit(11, "pt")) 

davidhodge931 avatar Apr 11 '24 23:04 davidhodge931