Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions lib/matplotlib/axes/_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -2108,9 +2108,10 @@ def bar(self, *args, **kwargs):
if edgecolor is None:
edgecolor = itertools.repeat(None)
else:
edgecolor = itertools.chain(mcolors.to_rgba_array(edgecolor),
# Fallback if edgecolor == "none".
itertools.repeat([0, 0, 0, 0]))
edgecolor = itertools.chain(
itertools.cycle(mcolors.to_rgba_array(edgecolor)),
# Fallback if edgecolor == "none".
itertools.repeat([0, 0, 0, 0]))

# lets do some conversions now since some types cannot be
# subtracted uniformly
Expand Down
9 changes: 6 additions & 3 deletions lib/matplotlib/tests/test_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -5260,12 +5260,15 @@ def test_eventplot_legend():
plt.legend()


def test_bar_single_height():
def test_bar_broadcast_args():
fig, ax = plt.subplots()
# Check that a bar chart with a single height for all bars works
# Check that a bar chart with a single height for all bars works.
ax.bar(range(4), 1)
# Check that a horizontal chart with one width works
# Check that a horizontal chart with one width works.
ax.bar(0, 1, bottom=range(4), width=1, orientation='horizontal')
# Check that edgecolor gets broadcasted.
rect1, rect2 = ax.bar([0, 1], [0, 1], edgecolor=(.1, .2, .3, .4))
assert rect1.get_edgecolor() == rect2.get_edgecolor() == (.1, .2, .3, .4)


def test_invalid_axis_limits():
Expand Down