Closed grantmcdermott closed 6 months ago
My current thinking: Add a par2()
function for setting these additional global options, which would also "nest" conventional par
arguments. (With the latter being passed through ...
?) Supporting the nesting/passing of regular par
arguments would allow users just to do everything through a single par2()
call, instead of trying to remember which global options are supported by which function.
So, for example, par2(grid = TRUE, las = 1)
would enact the first argument directly, but pass the second argument to par()
internally.
Is par2()
planned to be used only for plot2
or perhaps for other derived custom functions, and thus would par2
members/fields be hard-coded?
For instance, I create a new plot (not necessarily) based on plot2
with a new argument specifying whatever. I would like to offload some parameters to par
, but can't since those are hard-coded, this is impossible.
Also, something like plot2(..., style = par2(...))
to create a few styles that could be passed around would be cool, although I can't imagine many normal uses for this.
Love the PKG btw! Big fan of base R graphics and constantly annoyed by the difficulty of plotting legend.
Hi @J-Moravec sorry for being slow; this issue has been on the backburner. I’m going to turn my attention to it once #83 is merged (since that actually introduces par2
as a side effect, which could then be refined and expanded on).
Tbh I’m strongly inclined towards hard coding the par2 fields, since this would give us better control. No promises, but maybe if you can give some concrete examples I’ll reconsider?
Thanks for kind words about the package!
Closing, since the scaffolding for this now exists via par2
.
At the moment, only a few global options are supported. I also haven't integrated the forward passing of arguments from par2
on to par
. (I like the convenience of this latter idea.) But these features will be added in time.
Please feel free to raise suggestions for the specific par2
parameters/features as separate issues.
Allow users to set things outside of
par
. ~Palette defaults would be an obvious candidate.~ (Not true: Should be viapalette
as per #44). Maybe default legend position. Other "theme" options likegrid
andframe.plot
. Any others?