This repository was archived by the owner on Mar 22, 2026. It is now read-only.
Fix fill randomly not working in geom_bar + geom_histogram#567
Open
jdanbrown wants to merge 1 commit into
Open
Fix fill randomly not working in geom_bar + geom_histogram#567jdanbrown wants to merge 1 commit into
jdanbrown wants to merge 1 commit into
Conversation
This code randomly produces one of two graphs: ```py ggplot(diamonds, aes(x='clarity', fill='cut')) + geom_bar() ``` | randomly good | randomly bad |---|--- |  |  Problem: `geom._get_plot_args` renames keys in `mpl_params` according to `_aes_renames`, but not in a deterministic order. In particular, `geom_bar` and `geom_histogram` both include renames: - `color` -> `edgecolor` - `fill` -> `color` which when done in that order are fine but in the other order causes `color` to get dropped. Solution: use `OrderedDict` in `geom_bar` and `geom_histogram` to ensure that the `color` -> `edgecolor` rename happens before the `fill` -> `color` rename.
fec1a60 to
ca1e630
Compare
DSLituiev
suggested changes
Jan 2, 2017
DSLituiev
left a comment
There was a problem hiding this comment.
ggplot/geoms/geom.py, line 73 .items() need to be replaced with six.iteritems for backward compatibility
Contributor
Author
|
Good call, but there are two other occurrences of |
|
let us see what yhat people say. Opened issue #578. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This code randomly produces one of two graphs:
Problem:
geom._get_plot_argsrenames keys inmpl_paramsaccording to_aes_renames, but not in a deterministic order. In particular,geom_barandgeom_histogramboth include renames:color->edgecolorfill->colorwhich when done in that order are fine but in the other order causes
colorto get dropped.Solution: use
OrderedDictingeom_barandgeom_histogramto ensure that thecolor->edgecolorrename happens before thefill->colorrename.