Skip to content

BUG: Respect color argument in bar plot #17360

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

Merged
merged 1 commit into from
Sep 17, 2017

Conversation

TomAugspurger
Copy link
Contributor

This affect Series-like barplots with user-defined colors. We were always
treating them as dataframe-like, with one color per column.

closes #16822

This should go into 0.21.0, but if I have the time I'd like a put a more elegant solution in place.

Copy link
Member

@jorisvandenbossche jorisvandenbossche left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks OK to me (and not too hacky, it are really two different cases when plotting a bar plot)

@@ -374,6 +374,7 @@ I/O
Plotting
^^^^^^^^
- Bug in plotting methods using ``secondary_y`` and ``fontsize`` not setting secondary axis font size (:issue:`12565`)
- Bug in ``Series.plot.bar`` or ``DataFramee.plot.bar`` with ``y`` not respecting user-passed ``color`` (:issue:`16822`)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DataFramee typo

This affect Series-like barplots with user-defined colors. We were always
treating them as dataframe-like, with one color per column.
@codecov
Copy link

codecov bot commented Sep 17, 2017

Codecov Report

Merging #17360 into master will decrease coverage by 0.25%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #17360      +/-   ##
==========================================
- Coverage   91.25%   90.99%   -0.26%     
==========================================
  Files         163      162       -1     
  Lines       49614    49570      -44     
==========================================
- Hits        45274    45107     -167     
- Misses       4340     4463     +123
Flag Coverage Δ
#multiple 88.77% <100%> (-0.25%) ⬇️
#single 40.24% <0%> (-0.02%) ⬇️
Impacted Files Coverage Δ
pandas/plotting/_core.py 82.72% <100%> (+0.02%) ⬆️
pandas/io/s3.py 0% <0%> (-85%) ⬇️
pandas/io/gbq.py 25% <0%> (-58.34%) ⬇️
pandas/core/tools/datetimes.py 67.03% <0%> (-18.14%) ⬇️
pandas/plotting/_converter.py 63.23% <0%> (-1.82%) ⬇️
pandas/core/reshape/pivot.py 95.36% <0%> (-1%) ⬇️
pandas/core/indexes/interval.py 92.61% <0%> (-0.96%) ⬇️
pandas/io/common.py 67.79% <0%> (-0.85%) ⬇️
pandas/core/indexes/timedeltas.py 90.58% <0%> (-0.61%) ⬇️
pandas/core/common.py 91.44% <0%> (-0.54%) ⬇️
... and 35 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f5cfdbb...e02d8fd. Read the comment docs.

@codecov
Copy link

codecov bot commented Sep 17, 2017

Codecov Report

Merging #17360 into master will decrease coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #17360      +/-   ##
==========================================
- Coverage   91.25%   91.23%   -0.02%     
==========================================
  Files         163      163              
  Lines       49614    49617       +3     
==========================================
- Hits        45274    45268       -6     
- Misses       4340     4349       +9
Flag Coverage Δ
#multiple 89.02% <100%> (ø) ⬆️
#single 40.19% <0%> (-0.07%) ⬇️
Impacted Files Coverage Δ
pandas/plotting/_core.py 82.73% <100%> (+0.03%) ⬆️
pandas/io/gbq.py 25% <0%> (-58.34%) ⬇️
pandas/core/frame.py 97.77% <0%> (-0.1%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f5cfdbb...e02d8fd. Read the comment docs.

@TomAugspurger TomAugspurger merged commit 40e19bb into pandas-dev:master Sep 17, 2017
@TomAugspurger TomAugspurger deleted the barplot-color branch September 17, 2017 13:20
alanbato pushed a commit to alanbato/pandas that referenced this pull request Nov 10, 2017
This affect Series-like barplots with user-defined colors. We were always
treating them as dataframe-like, with one color per column.
No-Stream pushed a commit to No-Stream/pandas that referenced this pull request Nov 28, 2017
This affect Series-like barplots with user-defined colors. We were always
treating them as dataframe-like, with one color per column.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

plotting in pandas is not picking the list of colors passed, it only gets the first value
2 participants