Closed
Description
As requested by @story645, I am posting a possible bug I reported in the forum https://discourse.matplotlib.org/t/axhline-doesnt-cycle-through-colors/20938
When I plot horizontal lines using axhline
, there resulting lines are all the same color. It doesn’t cycle automatically. Is this behavior expected? Do I need to manually setup the color cycling? If so how can I do this easily? Why does matplotlib not automatically cycle through the colors for axhline
?
matplotlib v3.2.0
%matplotlib widget
import matplotlib.pyplot as plt
fig, ax = plt.subplots()
count = 5
for n in range(count):
ax.axhline(y=n**2, label=n)
ax.legend()
plt.show()