Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

color should set both facecolor and edgecolor in pyplot.bar #2218

Closed
lguez opened this Issue Jul 12, 2013 · 3 comments

Comments

Projects
None yet
4 participants

lguez commented Jul 12, 2013

In pyplot.bar, the color keyword argument is equivalent to facecolor. This is not consistent with set_color. set_color is a shortcut to set both facecolor and edgecolor for a collection or a patch or a spine or anything that has both face and edge. The color keyword of bar should set both face and edge color. See an example in

http://stackoverflow.com/questions/17451223/color-should-set-both-facecolor-and-edgecolor-in-pyplot-bar

Member

dmcdougall commented Aug 17, 2013

The question is, is this a bug in pyplot.bar or is it a bug in the documentation? I think I'm leaning towards this being a bug in the code. It looks like the color kwarg is inconsistent with collections, as is pointed out in the StackOverflow post.

Fixing bar would be a backwards-incompatible change, as is also pointed out on the SO page. That said, I'm not opposed to fixing this, as long as it's merged into master. Is anyone else opposed to this idea?

Fixing the documentation, on the other hand, is not backwards incompatible and can be backported to all the other branches. See #2308.

Contributor

lebigot commented Aug 18, 2013

I vote for consistency with set_color, as this follows the principle of least surprise, because bar edges are often quite discrete, and because people who play with bar edges can easily change back their color to the old default if needed.

When a non-default value is used for the color, maybe a warning could be issued that mentions that the edge color is also set?

Also, would adding a facecolor keyword argument be useful? this would make the intended effect of the color argument more obvious.

Owner

tacaswell commented Jan 17, 2014

@dmcdougall Closing this as I think the doc update is good enough, reopen if you disagree.

@tacaswell tacaswell closed this Jan 17, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment