-
Notifications
You must be signed in to change notification settings - Fork 20
Open
Description
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:5is sufficient for getting five points in five different colors. - In tinyplot this is identified as a scenaria with only a single
bygroup and hence only one color is used. - This can only be changed easily with a categorical
byvariable.
Maybe in the case without by variable we need to reconsider the color recycling rules?
jangorecki and grantmcdermott
Metadata
Metadata
Assignees
Labels
No labels