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
Implemented fix to issue 196 on github for log=True and histtype='step' #1029
Conversation
@@ -7861,7 +7861,8 @@ def hist(self, x, bins=10, range=None, normed=False, weights=None, | |||
|
|||
x[0::2], x[1::2] = bins, bins | |||
|
|||
minimum = min(bins) | |||
ndata = np.array(n) | |||
minimum = (ndata[ndata>0].min())*0.1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wouldn't we only want to do this for 'log'? Also, since bins is a list and the operation is just a simple filter, let's go with that route.
Add a comment for the rationale for the filtering and also for the 0.1 multiplication.
only want to set min this way if log is specified. Also, added case for normed vs not
@WeatherGod - I think you're right, you only want to do it this way for log. You also want different minima for normed vs not. |
Why 0.1? What is special about that number versus any other number? Could it accidentially be related to the fact that the default number of bins is 10 (I think)? If so, then we can't rely on that. |
No, 0.1 corresponds to one tick label unit for log plots assuming log base
|
ok, so probably the only thing left is to add a test for this. If you need help with that, just let me know. |
It should probably use the log's actual base -- it's 10 by default, but it could be anything. |
This should go in v1.2.x, it's a fix. I'm milestoning it as such. @keflavich Are you able to add a test for this? If not I can fork your branch and move this forward. |
Best if you go ahead; I'll not have a chance for at least a week |
Resolved in #1684. |
A solution was proposed in Issue #196. This pull request implements that proposed solution.