Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

mdboom
Copy link
Member

@mdboom 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])
plt.show()

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:

mpl_head

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!):

http://stackoverflow.com/questions/16862501/draw-a-step-histogram-without-closing-the-polygon-with-the-bottom-line

@mdboom
Copy link
Member

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
Copy link
Contributor

neggert commented Jun 3, 2013

Looks good to me.

mdboom added a commit that referenced this pull request Jun 3, 2013
hist() bottom line now showing (regression?)
@mdboom mdboom merged commit 356cb4c into matplotlib:v1.3.x Jun 3, 2013
@mdboom mdboom deleted the histogram-step-unfilled-bottom-line branch August 7, 2014 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants