Closed grantmcdermott closed 1 year ago
Upon reflection, it's probably better (easier) from a maintenance perspective just to do this via cex
. Here, using a similar rescaling factor to ggplot2.
rscl = function (x) {
from = range(x)
to = c(1, 6)
(x - from[1])/diff(from) * diff(to) + to[1]
}
with(
data.frame(state.x77),
plot(
x = Income, y = Life.Exp,
pch = 21,
cex = rscl(Population),
col = "white",
bg = palette.colors(n = 4, alpha = 0.5)[-1],
main = "Life expectancy among US states (1977)"
)
)
Created on 2023-07-27 with reprex v2.0.2
Closing in favour of #48.
Mostly for bubble charts. You can imagine the background colour below being assigned by group (as opposed to random recycling here).
Created on 2023-04-17 with reprex v2.0.2