Skip to content

new margin system doesn't handle negative values in bars #7175

Closed
@anntzer

Description

@anntzer

While working on #5538 (comment) (allow artists to opt-out from being considered by the autoscaler), I noticed that the new margins machinery doesn't handle negative values in bar plots very well:

from matplotlib import pyplot as plt
fig, axs = plt.subplots(1, 2)

# wanted behavior: remove the margin at y=0.
axs[0].bar(0, 1)

# unwanted behavior: remove the margin at y=-1
axs[1].bar(0, -1)

plt.show()

bar

attn @mdboom

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