grantmcdermott / tinyplot

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

Use consistent dot.case for `tinyplot` arguments #149

Closed grantmcdermott closed 3 months ago

grantmcdermott commented 5 months ago

Originally noted in https://github.com/grantmcdermott/tinyplot/issues/108#issuecomment-2054108545, but tracking here for paper trail.

One annoying UX inconsistency that I meant to fix a while back is that par_restore (and ribbon_alpha) snake_case, whereas all the other tinyplot arguments are dot.case. So I’ll aim to address that as well here.

As an aside, I'm not much a fan of dot.case arguments because I feel it lends itself to potential confusion with S3 method dispatch. But our hands are tied here b/c we want to priortize consistency with existing plot arguments.

(OTOH draw_legend arguments all take snake_case. I want to keep this distinction as-is because: (a) draw_legend is mostly intended as an internal function that we only export in case it's useful for users to create their own legends, and (b) it helps to keep track of things when passing/inheriting arguments internally.)