-
Notifications
You must be signed in to change notification settings - Fork 572
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incomplete Legends #94
Comments
Thats suspiciously the same number as there are colors defined. Current HEAD lets you set more than 8 colors via If that works, this should probably be fixed by throwing an error when the last color is used in |
@JanSchulz Good catch. Thats exactly what it was. If you add 32 color to The simple fix, as you say, is to make a default color pallete with more colors. Because the generators are called later in the How does the original ggplot do this? They have a consistent color scheme but I don't know how its mapped. |
They know the number of items and then ask a function in the scale package for the number of colors. This would mean that the current implementation needs to change, as currently color generator does not know the number of values it needs to generate. I will have a look... |
In |
Yeah this sounds good. I believe it has already been merged. |
Nope: the problem is in https://github.com/yhat/ggplot/blob/master/ggplot/components/colors.py -> it recyles the last color, but the code is doing a reverse coding https://github.com/yhat/ggplot/blob/master/ggplot/ggplot.py#L340 which results that the second round The fix is to a) precompute the number of colors needed and b) use a color generator which can give an arbitrary number of colors (that's what ggplot2 does) I suspect that both variants are need for the case when you manually specify colors but they are not enough for the given values. |
fixed in 0.9.3 |
Legends do not always contain all of the members in the legend. Here is an example with built in data where there should be 32 although only eight get plotted. I've tried a couple of examples and the legend seems to max out at eight. Most use cases won't need 32 but I often have more than eight items in a legend.
The text was updated successfully, but these errors were encountered: