In #410 we had improved the colour recycling when groups are defined using a by variable. This still seems to be fine to me.
When there is no by variable, i.e., only y and/or x, then only a single color is used because there is only a single by group. This makes sense in many situations but sometimes you want to color every point/line/bar with a different color (as in #476). This is possible in base R's plot() but in tinyplot() it requires setting up a suitable by variable.
As a simple example, consider plotting points 1:5 in colors 1:5:
plot(1:5, col = 1:5, pch = 19, cex = 5)
tinyplot(1:5, col = 1:5, pch = 19, cex = 5)
tinyplot(1:5, col = 1:5, pch = 19, cex = 5, by = factor(1:5), legend = FALSE)
- In base R just setting
col = 1:5 is sufficient for getting five points in five different colors.
- In tinyplot this is identified as a scenaria with only a single
by group and hence only one color is used.
- This can only be changed easily with a categorical
by variable.
Maybe in the case without by variable we need to reconsider the color recycling rules?
In #410 we had improved the colour recycling when groups are defined using a
byvariable. This still seems to be fine to me.When there is no
byvariable, i.e., onlyyand/orx, then only a single color is used because there is only a singlebygroup. This makes sense in many situations but sometimes you want to color every point/line/bar with a different color (as in #476). This is possible in base R'splot()but intinyplot()it requires setting up a suitablebyvariable.As a simple example, consider plotting points
1:5in colors1:5:col = 1:5is sufficient for getting five points in five different colors.bygroup and hence only one color is used.byvariable.Maybe in the case without
byvariable we need to reconsider the color recycling rules?