grantmcdermott / tinyplot

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

Function with alternative syntax #215

Closed strengejacke closed 1 week ago

strengejacke commented 1 week ago

Not sure if one of the goals is to encourage learning about base R graphics, but some of the arguments in base R don't have very intuitive names (like pch, cex, lty, ...), which makes the usage of base R graphics harder for beginners (and probably even people who already work since years with R, like me - I'm also struggling).

My suggestion: add a new function that simply wraps tinyplot(), but which only differs in their argument names.

e.g.

tinyplot_2(data, dot_style = "filled", dot_size = 12)

which internally just calls

tinyplot(data, pch = 16, cex = 3)

What do you think?

vincentarelbundock commented 1 week ago

Right. I understand the impulse and agree that some of the names are unintuitive.

But consistency with Base is one of the major benefits and key design decisions. And I really really don't think we should go down this rabbit hole.

Someone could easily write a friendlyplot wrapper if they want. But tinyplot should focus on drawing plots, not reinventing the interface.

strengejacke commented 1 week ago

Yeah, I didn't want to alter the initial design decision. Just an additional (optional) wrapper function. But I see the point that the maintenance load would increase and out of the package's scope.

grantmcdermott commented 1 week ago

+1 to @vincentarelbundock's comment. I think it's scope creep that could add a non-trivial maintenance burden without super clear upside.

Two "for what it's worth"s though:

  1. We do support a few aliases like fill for bg. But this is partly to ensure better consistency across different base plot types (e.g., we always use col instead of border, so fill seemed a natural companion to include here).
  2. I would like to include a "base/tinyplot for ggplot2 users" vignette or slidedeck at some point. Something for the backburner!
grantmcdermott commented 1 week ago

PS. Forgot to add: thanks for the suggestion @strengejacke. It's always great to get feedback and suggestions from engaged new users.