Skip to content

Default bottom of Stepfilled histograms should be set according to ymin #4621

Closed
@jenshnielsen

Description

@jenshnielsen

Follow up to #4606 and #4608

Compare bar:

import numpy
import matplotlib.pyplot as plt
fig, ax = plt.subplots(1,1)
hist1 = ax.hist(1, bins=1, normed=False, log=True, histtype='bar', label='No bottom', alpha=1, facecolor='red')
offset = 1e-9
ax.set_ylim(1e-4, 1.1)
ax.legend()
plt.show()

bar

to stepfilled:

import numpy
import matplotlib.pyplot as plt
fig, ax = plt.subplots(1,1)
hist1 = ax.hist(1, bins=1, normed=False, log=True, histtype='stepfilled', label='No bottom', alpha=1, facecolor='red')
offset = 1e-9
ax.set_ylim(1e-4, 1.1)
ax.legend()
plt.show()

stepfilled

Setting bottom is not really a correct solution since it shifts the top of the bar with the same amount

Metadata

Metadata

Assignees

No one assigned

    Labels

    Difficulty: Mediumhttps://matplotlib.org/devdocs/devel/contribute.html#good-first-issues

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions