Skip to content

Defaults need improvements #32

@manuelhelmerichs

Description

@manuelhelmerichs

We need to improve the default colour schemes, text sizes, line widths, etc., so saving with defaults produces figures that look great and readable when used in lecture slides / exercises.

Discrete palette

For the discrete case we need a better default, currently for two categories I can barely tell apart the colors as opposed to when I manually tweak the viridis settings:

library(vistool)
library(ggplot2)

getOption("vistool.theme")
#> $palette
#> [1] "viridis"
#> 
#> $text_size
#> [1] 11
[...]


p <- ggplot(mtcars, aes(x = wt, y = mpg, color = factor(vs))) +
  geom_point() +
  theme_vistool()
p

p +
  theme(
    palette.colour.discrete = scales::pal_viridis(
      option = "H",
      begin = 0.2,
      end = 0.8
    )
  )

Created on 2026-01-27 with reprex v2.1.1

Not sure what to do here ideally, maybe it's worth switching scales for the discrete case, such as RColorBrewer's Dark2 palette:

image

Which I believe has a good "reputation" in terms of accessibility.

The scico palettes could also be useful, primarily in case we need diverging scales (with a neutral mid-ppoint, e.g. 0, and then clearly distinguishable low- and high-ends). That's kind of a special case though.

Originally posted by @jemus42 in #31 (comment)

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions