X Tutup
Skip to content

pyplot.bar does not cycle through colors (>2.0.0b1) #7891

@msspektor

Description

@msspektor

I hope I'm not reporting an issue that's already known. Starting with matplotlib==2.0.0b1, pyplot.bar does not cycle through colors anymore. Instead, if I pass list of colors, it only uses color 'C0'.

Minimum code to reproduce bug:

import matplotlib.pyplot as plt
x_pos = [0, 1, 2]
heights = [1, 2, 3]
colors = ['0.2', '0.5', '0.8']
print('Works properly:')
[plt.bar(left=x_pos[ii], height=heights[ii], color=colors[ii]) for ii in range(len(x_pos))]
plt.show()
print('Does not work aynmore:')
plt.bar(left=x_pos, height=heights, color=colors)
plt.show()

Output:

img

Here's the output using the same code with matplotlib==1.5.3

img2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      X Tutup