Closed zeileis closed 3 months ago
Related to this, I wonder if we should support an alpha = <[0,1]>
argument for easy transparency of colours?
On a recent project, I find myself doing variants of plt(many_points, col = adjustcolor("black", 0.1)
. It would be nicer to just write plt(many_points, alpha = 0.1)
. I'm not sure if this could be easily integrated with your fill = [0,1]
idea, or whether they should exist as separate arguments. Probably the latter.
I think that this will be nifty for some - and not confusing for those who don't need it. So it sounds like a useful addition to me.
... and I agree that it should be a separate argument.
FWIW, this now works in the cran
branch.
library(tinyplot)
tinyplot(lat ~ long | depth, data = quakes, cex = 3, pch = 21, bg = 0.2)
Similarly, for the alpha
argument (which affects both the main col and fill, if applicable):
tinyplot(lat ~ long | depth, data = quakes, cex = 3, pch = 19, alpha = 0.2)
Created on 2024-06-17 with reprex v2.1.0
Should we support setting
bg = <numeric>
in [0, 1] as a shortcut forbg = adjustcolor(col, <numeric>)
(as discussed in https://github.com/grantmcdermott/tinyplot/pull/122)?This would be handy when we want to use
pch = 21:25
with some bordercol
and then automatically use a semi-transparent version of the same color as thebg
fill. But maybe this is too specialized and esoteric to implement a special shortcut.Application example:
The idea would be to abbreviate the last argument to just
bg = 0.1
.