grantmcdermott / tinyplot

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

`tpar()` could pass extra arguments to `par()` #123

Closed vincentarelbundock closed 3 months ago

vincentarelbundock commented 4 months ago

Would be nice to have a single interface to set graphical parameters.

grantmcdermott commented 3 months ago

Question: Should we support setting/passing a default color palette through tpar too?

For example: tpar(palette = "tableau") or tpar(palette = "harmonic")?

Or is that trying to be too clever?

zeileis commented 3 months ago

I just noticed that I wanted to respond to this but never had:

I think adding tpar(palette = ...) would be consistent with having the added tinyplot(..., palette = ...) argument.

It could be useful when generating a sequence of similar plots and you want to use the same palette for all of them.

It's less useful for creating "themes" or so. For that it would be necessary to have a distinction between the default qualitative/categorical and the default sequential/ordered and the default diverging palette.

Hence, in summary, I think it would be of limited use - but it might be helpful for some and it would be easy to understand.