Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add grid() args to tpar? #235

Open
grantmcdermott opened this issue Oct 11, 2024 · 2 comments
Open

Add grid() args to tpar? #235

grantmcdermott opened this issue Oct 11, 2024 · 2 comments

Comments

@grantmcdermott
Copy link
Owner

At present, we support a simple logic argument for automatically drawing a grid all plots via tpar(grid = TRUE).

But this doesn't give users much control over how their grids look, since it enforces the default colour ("lightgray"), line type ("dotted"), and width (par("lwd")).

It's not a huge deal, because users can adjust these settings for individual plots by passing grid = grid(...) in the tinyplot call.

tinyplot(
    sin(0:100/10), axes = "l",
    grid = grid(col = "hotpink", lty = "solid")
)

But... thinking ahead to our goal of enabling themes (#234), maybe it's a low cost intervention to define these grid elements globally in tpar(grid.col = 'lightgray", grid.lty = "dotted", grid. lwd = 1).

@zeileis
Copy link
Collaborator

zeileis commented Oct 13, 2024

I think it would be good to have control over this using standard evaluation so I'm in favor of adding grid.col, grid.lty, grid.lwd in tpar(). Maybe it would be useful to be able to pass them directly to tinyplot() as well?

@vincentarelbundock
Copy link
Collaborator

I'd vote yes for that(), which can have a ton of arguments, but I'd prefer limiting the number of arguments in tiny plot(), and the status quo already gives us an easy way to do this with grid=grid()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants