grantmcdermott · GitHub

Closes #577
Closes #193

Also makes it easy to add only vertical or horizontal grid lines, which opens up support for some new themes... e.g. broadsheet publications like Financial Times, Economist, etc. tend to use single axis grid lines in all of their plots.

Some examples:

pkgload::load_all("~/Documents/Projects/tinyplot")
#> ℹ Loading tinyplot
plt(wt ~ mpg | factor(cyl), mtcars, grid = 'xy')

plt(wt ~ mpg | factor(cyl), mtcars, grid = 'xY')

plt(wt ~ mpg | factor(cyl), mtcars, grid = 'Y')

And, of course, the main attraction is using a finer grid for certain themes. Here's a riff on our proposed improvements to the "ipsum" theme in #409.

tinytheme(
  "ipsum", family = "Arial Narrow", font.main = 2, font.sub = 1, cex.lab = 0.8,
  palette.qualitative = c("#D18975", "#8FD175", "#3F2D54", "#75B8D1", "#2D543D", "#C9D175", "#D1AB75", "#D175B8", "#758BD1"),
  tcl = -0.0,  mgp = c(1.5, 0.5, 0) - c(0.0+0.1, 0.1, 0),
  grid = "xy"
)
plt(
  wt ~ mpg | factor(cyl), mtcars,
  xlab="Fuel efficiency (mpg)", ylab="Weight (tons)",
  main="Seminal tinyplot scatterplot example",
  sub="A plot that is only useful for demonstration purposes"
)

tinytheme()

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

Read the original on github.com ↗