Skip to content

themes: Adjust ribbon.alpha for "dark" theme? #602

@grantmcdermott

Description

@grantmcdermott

Currently, we just inherit the default 0.2 value that's used by all of the other plots. But I don't think this looks great (too wan) against the black background.

library("tinyplot")
tinytheme("dark")
plt(
  ~flipper_len | species,
  data = penguins, 
  type = "hist",
  breaks = 30,
)

plt(
  body_mass ~ species | sex, data = penguins,
  type = type_boxplot(boxwex = 0.6, staplewex = 0, outline = FALSE),
  lty = 1,
  flip = TRUE, yaxl = ",",
)

plt(eruptions ~ waiting, data = faithful,
  xlab = "Eruption time (min)",
  ylab = "Waiting time to next eruption (min)",
  main = "Eruptions of Old Faithful",
  type = "loess"
)

ribbon.alpha = 0.4

Compare if we bump it up a bit to 0.4:

tinytheme()
tinytheme("dark", ribbon.alpha = 0.4)
plt(
  ~flipper_len | species,
  data = penguins, 
  type = "hist",
  breaks = 30,
)

plt(
  body_mass ~ species | sex, data = penguins,
  type = type_boxplot(boxwex = 0.6, staplewex = 0, outline = FALSE),
  lty = 1,
  flip = TRUE, yaxl = ",",
)

plt(eruptions ~ waiting, data = faithful,
  xlab = "Eruption time (min)",
  ylab = "Waiting time to next eruption (min)",
  main = "Eruptions of Old Faithful",
  type = "loess"
)

ribbon.alpha = 0.5

Or, even more to 0.5.

tinytheme("dark", ribbon.alpha = 0.5)
plt(
  ~flipper_len | species,
  data = penguins, 
  type = "hist",
  breaks = 30,
)

plt(
  body_mass ~ species | sex, data = penguins,
  type = type_boxplot(boxwex = 0.6, staplewex = 0, outline = FALSE),
  lty = 1,
  flip = TRUE, yaxl = ",",
)

plt(eruptions ~ waiting, data = faithful,
  xlab = "Eruption time (min)",
  ylab = "Waiting time to next eruption (min)",
  main = "Eruptions of Old Faithful",
  type = "loess"
)

tinytheme()

Created on 2026-05-31 with reprex v2.1.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions