Automatically determine label color based on background color
In plots with inline text (labels), the text must be legible at all times, this entails changing the font color based on the background color.
The current workaround also advertised in the docs is to insert a new column into the dataframe that directly maps the color based on some threshold.
Since plotnine is responsible for mapping background colors, it could compute the font color for labels ad-hoc based on the background color such that it is always legible.
This would make the library more ergonomic for me. Currently, I spend more time than I would like to admit manually adjusting the threshold.
There is a function in this example called overlay_color (probably a bad name) that computes the a contrasting threshold and chooses between two colors. I plan to include a version of it in the next release 0.16.0 as part of some "toolbox" or something, but you will have to use it explicitly.
okay, thanks for the quick feedback. Looking forward to its release :D