Skip to content

Limits are reset when calling bar_labels #412

@cvanelteren

Description

@cvanelteren

When I tried to add labels for each bar, it strangely only drew a single bar. Does this mean I have to add the labels manually myself?

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

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

cycle = uplt.Cycle("RdYlGn", 5)

fig, ax = uplt.subplots(journal="nat1")
for idx, row in data.iterrows():
    ax.bar(idx, row.iloc[0], cycle=cycle, edgecolor="black", bar_labels=True)
Image

Originally posted by @lwq-star in #409

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