grantmcdermott / tinyplot

Lightweight extension of the base R graphics system
https://grantmcdermott.com/tinyplot
Apache License 2.0
204 stars 7 forks source link

Pass par args via tpar #140

Closed grantmcdermott closed 3 months ago

grantmcdermott commented 3 months ago

Closes #123.

MWE.

pkgload::load_all("~/Documents/Projects/tinyplot")
#> ℹ Loading tinyplot

# A plot with default params
tinyplot(mpg ~ wt, data = mtcars, facet = ~am)


# Set a mix of base and tinyplot global params
op = tpar(
    las       = 1,
    pch       = 2,
    facet.bg  = "grey90",
    facet.cex = 2,
    grid      = TRUE
)
# redraw the plot
tinyplot(mpg ~ wt, data = mtcars, facet = ~am)


# reset
tpar(op)
tinyplot(mpg ~ wt, data = mtcars, facet = ~am)

Created on 2024-03-15 with reprex v2.1.0

Still to do:

(Maybe decide about supporting palette() setting too.)