Revamped palette logic and colour recycling#410
Conversation
|
Grant, thanks for this, very much appreciated! It would be great if we extend these strategies to specifying the
I think it would be good to streamline this and make the first two options work like the third option, in case a color vector is specified. As an example consider your demo function with a short and a long example palette: The short specification But also the longer color vector |
|
Thanks for testing, Achim. I agree that consistency across themes and non-themes is important. I'll have a crack at fixing this evening. (It's great that we can provide so much flexibility for specifying colours and palettes on the user side, but, ugh, it's hard to catch all of these different edge cases on the dev side.) |
|
Thanks again for the catch @zeileis these should all be working now. pkgload::load_all("~/Documents/Projects/tinyplot/")
ddplot = function(...) plt(y ~ x | dataset, facet = "by", data = datasauRus::datasaurus_dozen, pch = 18, legend = FALSE, ...)
pal9 = palette.colors(palette = "Okabe-Ito")
pal26 = palette.colors(palette = "Alphabet")
ddplot(col = pal9) ## Recycle with warning
ddplot(palette = pal9) ## Recycle with warning
tinytheme(palette.qualitative = pal9)
ddplot() ## Recycle with warning
tinytheme()
ddplot(col = pal26) ## Works
ddplot(palette = pal26) ## Works
tinytheme(palette.qualitative = pal26)
ddplot() ## Works
tinytheme()I'm going to go ahead and merge, because (a) I think this covers most of everything we need and (b) I really need to turn my attention elsewhere. I'll be submitting a new version to CRAN very shortly, though! (Hopefully it goes through the checks without any problems.) |
Fixes #352
Created on 2025-05-21 with reprex v2.1.1