Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commited5afc8

Browse files
committed
Merged revisions 8588 via svnmerge from
https://matplotlib.svn.sf.net/svnroot/matplotlib/branches/v1_0_maint........ r8588 | mdboom | 2010-07-28 14:48:14 -0400 (Wed, 28 Jul 2010) | 2 lines [3032853] Hist autorange bug using log and histtype........svn path=/trunk/matplotlib/; revision=8589
1 parent9152332 commited5afc8

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

‎lib/matplotlib/axes.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7699,13 +7699,15 @@ def hist(self, x, bins=10, range=None, normed=False, weights=None,
76997699

77007700
x[0::2],x[1::2]=bins,bins
77017701

7702+
minimum=min(bins)
7703+
77027704
ifalign=='left'oralign=='center':
77037705
x-=0.5*(bins[1]-bins[0])
77047706
elifalign=='right':
77057707
x+=0.5*(bins[1]-bins[0])
77067708

77077709
iflog:
7708-
y[0],y[-1]=1e-100,1e-100
7710+
y[0],y[-1]=minimum,minimum
77097711
iforientation=='horizontal':
77107712
self.set_xscale('log')
77117713
else:# orientation == 'vertical'
@@ -7716,7 +7718,7 @@ def hist(self, x, bins=10, range=None, normed=False, weights=None,
77167718
form,cinzip(n,color):
77177719
y[1:-1:2],y[2::2]=m,m
77187720
iflog:
7719-
y[y<1e-100]=1e-100
7721+
y[y<minimum]=minimum
77207722
iforientation=='horizontal':
77217723
x,y=y,x
77227724

@@ -7729,19 +7731,19 @@ def hist(self, x, bins=10, range=None, normed=False, weights=None,
77297731

77307732
# adopted from adjust_x/ylim part of the bar method
77317733
iforientation=='horizontal':
7732-
xmin0=max(_saved_bounds[0]*0.9,1e-100)
7734+
xmin0=max(_saved_bounds[0]*0.9,minimum)
77337735
xmax=self.dataLim.intervalx[1]
77347736
forminn:
77357737
xmin=np.amin(m[m!=0])# filter out the 0 height bins
7736-
xmin=max(xmin*0.9,1e-100)
7738+
xmin=max(xmin*0.9,minimum)
77377739
xmin=min(xmin0,xmin)
77387740
self.dataLim.intervalx= (xmin,xmax)
77397741
eliforientation=='vertical':
7740-
ymin0=max(_saved_bounds[1]*0.9,1e-100)
7742+
ymin0=max(_saved_bounds[1]*0.9,minimum)
77417743
ymax=self.dataLim.intervaly[1]
77427744
forminn:
77437745
ymin=np.amin(m[m!=0])# filter out the 0 height bins
7744-
ymin=max(ymin*0.9,1e-100)
7746+
ymin=max(ymin*0.9,minimum)
77457747
ymin=min(ymin0,ymin)
77467748
self.dataLim.intervaly= (ymin,ymax)
77477749

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp