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

Skip to content

Commit 34c8990

Browse files
committed
some kwdoc fixes
svn path=/trunk/matplotlib/; revision=2954
1 parent 3bc3880 commit 34c8990

File tree

1 file changed

+10
-53
lines changed

1 file changed

+10
-53
lines changed

lib/matplotlib/axes.py

Lines changed: 10 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -2583,16 +2583,16 @@ def get_handles():
25832583
#### Specialized plotting
25842584

25852585

2586-
def bar(self, left, height, width=0.8, bottom=None,
2586+
def bar(self, left, height, width=0.8, bottom=0,
25872587
color=None, edgecolor=None, linewidth=None,
25882588
yerr=None, xerr=None, ecolor=None, capsize=3,
2589-
align='edge', orientation='vertical', log=False
2589+
align='edge', orientation='vertical'
25902590
):
25912591
"""
25922592
BAR(left, height, width=0.8, bottom=0,
25932593
color=None, edgecolor=None, linewidth=None,
25942594
yerr=None, xerr=None, ecolor=None, capsize=3,
2595-
align='edge', orientation='vertical', log=False)
2595+
align='edge', orientation='vertical')
25962596
25972597
Make a bar plot with rectangles bounded by
25982598
@@ -2631,9 +2631,6 @@ def bar(self, left, height, width=0.8, bottom=None,
26312631
26322632
orientation = 'vertical' | 'horizontal'
26332633
2634-
log = False | True - False (default) leaves the orientation
2635-
axis as-is; True sets it to log scale
2636-
26372634
For vertical bars, 'edge' aligns bars by their left edges in left,
26382635
while 'center' interprets these values as the x coordinates
26392636
of the bar centers.
@@ -2657,41 +2654,21 @@ def make_iterable(x):
26572654
return x
26582655

26592656
# make them safe to take len() of
2660-
_left = left
26612657
left = make_iterable(left)
26622658
height = make_iterable(height)
26632659
width = make_iterable(width)
2664-
_bottom = bottom
26652660
bottom = make_iterable(bottom)
26662661
linewidth = make_iterable(linewidth)
26672662

2668-
adjust_ylim = False
2669-
adjust_xlim = False
26702663
if orientation == 'vertical':
2671-
if log:
2672-
self.set_yscale('log')
26732664
# size width and bottom according to length of left
2674-
if _bottom is None:
2675-
if self.get_yscale() == 'log':
2676-
bottom = [1e-100]
2677-
adjust_ylim = True
2678-
else:
2679-
bottom = [0]
26802665
nbars = len(left)
26812666
if len(width) == 1:
26822667
width *= nbars
26832668
if len(bottom) == 1:
26842669
bottom *= nbars
26852670
elif orientation == 'horizontal':
2686-
if log:
2687-
self.set_xscale('log')
26882671
# size left and height according to length of bottom
2689-
if _left is None:
2690-
if self.get_xscale() == 'log':
2691-
left = [1e-100]
2692-
adjust_xlim = True
2693-
else:
2694-
left = [0]
26952672
nbars = len(bottom)
26962673
if len(left) == 1:
26972674
left *= nbars
@@ -2783,25 +2760,11 @@ def make_iterable(x):
27832760

27842761
self.hold(holdstate) # restore previous hold state
27852762

2786-
if adjust_xlim:
2787-
xmin, xmax = self.dataLim.intervalx().get_bounds()
2788-
xmin = amin(w)
2789-
if xerr is not None:
2790-
xmin = xmin - amax(xerr)
2791-
xmin = max(xmin*0.9, 1e-100)
2792-
self.dataLim.intervalx().set_bounds(xmin, xmax)
2793-
if adjust_ylim:
2794-
ymin, ymax = self.dataLim.intervaly().get_bounds()
2795-
ymin = amin(h)
2796-
if yerr is not None:
2797-
ymin = ymin - amax(yerr)
2798-
ymin = max(ymin*0.9, 1e-100)
2799-
self.dataLim.intervaly().set_bounds(ymin, ymax)
28002763
self.autoscale_view()
28012764
return patches
28022765

28032766

2804-
def barh(self, bottom, width, height=0.8, left=None,
2767+
def barh(self, bottom, width, height=0.8, left=0,
28052768
color=None, edgecolor=None, linewidth=None,
28062769
xerr=None, yerr=None, ecolor=None, capsize=3,
28072770
align='edge'
@@ -4301,13 +4264,11 @@ def table(self, **kwargs):
43014264
#### Data analysis
43024265

43034266

4304-
def hist(self, x, bins=10, normed=0, bottom=None,
4305-
align='edge', orientation='vertical', width=None,
4306-
log=False, **kwargs):
4267+
def hist(self, x, bins=10, normed=0, bottom=0,
4268+
align='edge', orientation='vertical', width=None, **kwargs):
43074269
"""
4308-
HIST(x, bins=10, normed=0, bottom=None,
4309-
align='edge', orientation='vertical', width=None,
4310-
log=False, **kwargs)
4270+
HIST(x, bins=10, normed=0, bottom=0,
4271+
align='edge', orientation='vertical', width=None, **kwargs)
43114272
43124273
Compute the histogram of x. bins is either an integer number of
43134274
bins or a sequence giving the bins. x are the data to be binned.
@@ -4334,8 +4295,6 @@ def hist(self, x, bins=10, normed=0, bottom=None,
43344295
width: the width of the bars. If None, automatically compute
43354296
the width.
43364297
4337-
log: if True, the histogram axis will be set to a log scale
4338-
43394298
kwargs are used to update the properties of the
43404299
hist Rectangles:
43414300
%(Rectangle)s
@@ -4344,11 +4303,9 @@ def hist(self, x, bins=10, normed=0, bottom=None,
43444303
n, bins = matplotlib.mlab.hist(x, bins, normed)
43454304
if width is None: width = 0.9*(bins[1]-bins[0])
43464305
if orientation == 'horizontal':
4347-
patches = self.barh(bins, n, height=width, left=bottom,
4348-
align=align, log=log)
4306+
patches = self.barh(bins, n, height=width, left=bottom, align=align)
43494307
elif orientation == 'vertical':
4350-
patches = self.bar(bins, n, width=width, bottom=bottom,
4351-
align=align, log=log)
4308+
patches = self.bar(bins, n, width=width, bottom=bottom, align=align)
43524309
else:
43534310
raise ValueError, 'invalid orientation: %s' % orientation
43544311
for p in patches:

0 commit comments

Comments
 (0)