Open ericmelse opened 1 year ago
This has been requested for several packages esp sankey
. A potential solution is to add a colorby(variable)
option. This allows users to define their own order, highlight certain regions, and keep full control of the colors.
Also the default color order is alphabetical. A numerical or a level sort has been implented in sankey but has not been ported over to alluvial
.
Merge with #12
Dear Asjad, It is great to be able to use Ben Jann's palettes and colrspace to control colors, but, that implies (on first sight) their general use and much less their specific use for color coding categories on leveld. Myself, I am very 'picky' when it comes to the control of colors and rather want to select them individually for about anything. But, let me first follow your guidelines and run my example using:
which results in:
Never mind the cluttered labels at the levels and the super small level titels (we deal with that later).
Note that I have used
I analyse where which palette color was used by
My first thought is 'how does this come about'? What logic decides to use which color for the individual categories at each level?
Should your code apply some algorithm to 'cherry pick' colors from the palette, possibly people will appreciate that (no pun intended).
But, I would like to be in control and be able to assign (set) selected colors of such palette to the levels.
I can think of various ways of coding that but forgive me for being ignorant what would be the most concise but flexible way of coding.
For example, could:
palette(carto)
and that by inspection of that palette, using:alluvial
, using:work in your module? Like with my Example:
palette(carto) levelcolors(1 "5 2 7" 2 "3 10 7" 3 "6 9 1 8")
Ideally, I also really would like to be able to control the colors using all Stata's parameters for colors, like:
Well, I submit to you that I am a 'demanding' person.
Best, Eric