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
Autoscale in hist() with step and log #159
Comments
Here's a script plotting steps and bars: In [1]: import matplotlib
In [2]: matplotlib.use('agg')
In [3]: import matplotlib.pyplot as plt
In [4]: fig = plt.figure()
In [5]: ax = fig.add_subplot(2, 1, 1)
In [6]: import numpy as np
In [7]: ax.hist(np.random.rand(100), histtype='step', log=1)
Out[7]:
(array([10, 12, 2, 8, 11, 7, 12, 15, 11, 12]),
array([ 0.00352264, 0.10181859, 0.20011454, 0.2984105 , 0.39670645,
0.4950024 , 0.59329835, 0.6915943 , 0.78989025, 0.8881862 ,
0.98648216]),
<a list of 1 Patch objects>)
In [8]: ax2 = fig.add_subplot(2, 1, 2)
In [9]: ax2.hist(np.random.rand(100), log=1)
Out[9]:
(array([11, 8, 13, 6, 9, 6, 16, 10, 12, 9]),
array([ 0.00454384, 0.10397154, 0.20339924, 0.30282694, 0.40225465,
0.50168235, 0.60111005, 0.70053775, 0.79996545, 0.89939315,
0.99882086]),
<a list of 10 Patch objects>)
In [10]: fig.savefig('hists.png')
In [11]: !open hists.png And here's sample output: I don't think there's anything wrong. As @mdboom pointed out in the original email, the axes contain all the data. Perhaps the in the case where I think this issue can probably be closed, but I'll leave it open for a few days just in case I'm missing something. |
While the ranges are different, neither look "broken". We don't have an end user for this one, so I would second your assertion that this can be closed. |
@pelson Thanks. I thought as much. |
Original report at SourceForge, opened Tue Jun 22 07:58:14 2010
The autoscale seems to be broken in trunk in this example:
from pylab import *
hist(rand(100),bins=20,histtype="step",log=1)
SourceForge Comments
On Wed Aug 4 10:24:05 2010, None wrote:
Sorry for not being explicit enough. The lower y-limit was previously set to a value closer to the lowest non-zero bin, and not 1E-100.
That being said, the behaviour in rev 8623 is actually sane again.
On Tue Jul 6 15:17:38 2010, mdboom wrote:
Can you be more specific about what you would have expected to see?
On Tue Jun 29 08:05:07 2010, None wrote:
Uploaded the plot that I get here, from rev 8475.
On Thu Jun 24 10:51:32 2010, mdboom wrote:
In what way is it broken? The axes appears to contain all of the data. Some of the lines are right under the axes line at the top, but that is expected behavior. If you want some "padding", that would have to be added manually.
SourceForge History
The text was updated successfully, but these errors were encountered: