Conversation
|
This was exactly what I was thinking of in the digression here: #236 (comment) Great minds etc. ;-) I really like the idea and think that this is a feature that would get a lot of use. I'll be able to take a look at it tomorrow (or whenever you move it out of draft). |
|
@grantmcdermott I added docs and a test. You might want to look at this now. |
| ) { | ||
|
|
||
| # save for plt_add() | ||
| options(tinyplot_last_call = match.call(tinyplot, |
There was a problem hiding this comment.
To be consistent with the rest of the package infrastructure, let's rather save this to the existing .tinyplot_env. This is what we use in R/get_saved_par.R, for an example:
Lines 104 to 116 in 02d7806
We'll need to assign NULL values to this call object at startup in R/zzz.R too, e.g.
Line 46 in 02d7806
There was a problem hiding this comment.
Unfortunately, I was unable to get this to work. I kept getting an error in the tinyplot.density tests. The message is obscure, having to do with a do.call and a substitute. I just can figure this out.
My guess is that this will disappear by itself when we refactor the density code.
In the meantime, I left TODOs in both files with the appropriate save code that we can eventually.
Feel free to take a shot at it if you want, but I have to give up for now.
|
This is great. Thanks @vincentarelbundock! |
I’ve been trying to think about ways to make it easier to layer plots. We have
add=TRUE, but it is not very convenient, because we need to repeat all the same arguments in every call.I can’t decide if this is a good or a terrible idea, but here’s a proof of concept for you to comment on:
plt(), we save the full call somewhere (global option or other).plt_add()add=TRUEThis proof of concept PR allows things like:
Note: Facets don’t seem to work in this PR.