Skip to content

Set color for each bar #409

@lwq-star

Description

@lwq-star

Hello, when I was drawing a bar chart, I noticed that ultraplot cannot set a color for each individual bar. Could you add this feature?

import ultraplot as uplt
import numpy as np
import pandas as pd

fig, ax = uplt.subplots(journal='nat1')

x = np.arange(5)
y = [10, 15, 7, 12, 9]
data = pd.DataFrame(y, index=x)

cycle = uplt.Cycle('RdYlGn', 5)
obj = ax.bar(data, cycle=cycle, edgecolor='black')
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions