Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

hist() bottom line now showing (regression?) #2113

merged 1 commit into from Jun 3, 2013


None yet
2 participants

mdboom commented Jun 3, 2013

The following:

import numpy as np
import matplotlib.pyplot as plt

mu, sigma = 100, 15
x = mu + sigma * np.random.randn(10000)
fig = plt.figure()
ax = fig.add_subplot(111)
n, bins, patches = ax.hist(x, 50, normed=1, histtype='step')
plt.ylim(-.005, plt.ylim()[1])

produces this in 1.1.0 (although I manually zoomed in here since 1.1.0 didn't set the upper limit on ylim correctly):

mpl_1 1 0

but at the HEAD the path is now closed by a bottom line:


Would this be considered as a regression? Could an argument be created to allow the user to decide if the bottom line should be displayed? In most of my plots showing a step histogram (usually overlaid on some filled histograms) the bottom line is not desirable.

I originally asked how to remove the bottom line on SO (thanks to @tacaswell for the answer!):



mdboom commented Jun 3, 2013

I've attached a possible fix for this issue. The behavior is restored to what (I believe) was intended, which is that the bottom line is only included when the histogram is stepfilled, not merely step.

@neggert: Would you mind giving this a look since you were the last to really rework the histogram code?


neggert commented Jun 3, 2013

Looks good to me.

mdboom added a commit that referenced this pull request Jun 3, 2013

@mdboom mdboom merged commit 356cb4c into matplotlib:v1.3.x Jun 3, 2013

1 check failed

default The Travis CI build failed

@mdboom mdboom deleted the mdboom:histogram-step-unfilled-bottom-line branch Aug 7, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment