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

Skip to content

Commit 253848b

Browse files
committed
Updated method call signature for barh, and synchronized docstrings of
bar and barh svn path=/trunk/matplotlib/; revision=3043
1 parent f3546ae commit 253848b

1 file changed

Lines changed: 37 additions & 32 deletions

File tree

lib/matplotlib/axes.py

Lines changed: 37 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -2724,7 +2724,7 @@ def bar(self, left, height, width=0.8, bottom=None,
27242724
27252725
height - the heights of the bars
27262726
2727-
Optional arguments
2727+
Optional arguments:
27282728
27292729
width - the widths of the bars
27302730
@@ -2742,28 +2742,26 @@ def bar(self, left, height, width=0.8, bottom=None,
27422742
27432743
ecolor specifies the color of any errorbar
27442744
2745-
capsize determines the length in points of the error bar caps
2745+
capsize (default 3) determines the length in points of the error
2746+
bar caps
27462747
2747-
align = 'edge' | 'center'
2748+
align = 'edge' (default) | 'center'
27482749
27492750
orientation = 'vertical' | 'horizontal'
27502751
27512752
log = False | True - False (default) leaves the orientation
27522753
axis as-is; True sets it to log scale
27532754
2754-
For vertical bars, 'edge' aligns bars by their left edges in left,
2755-
while 'center' interprets these values as the x coordinates
2756-
of the bar centers.
2757-
For horizontal bars, 'edge' aligns bars by their bottom edges
2758-
in bottom,
2759-
while 'center' interprets these values as the y coordinates
2760-
of the bar centers.
2755+
For vertical bars, align='edge' aligns bars by their left edges in
2756+
left, while 'center' interprets these values as the x coordinates of
2757+
the bar centers. For horizontal bars, 'edge' aligns bars by their
2758+
bottom edges in bottom, while 'center' interprets these values as the
2759+
y coordinates of the bar centers.
27612760
2762-
The optional arguments color, edgecolor, yerr, and xerr can be either
2763-
scalars or sequences of length equal to the number of bars
2764-
2765-
This enables you to use bar as the basis for stacked bar
2766-
charts, or candlestick plots
2761+
The optional arguments color, edgecolor, linewidth, xerr, and yerr can
2762+
be either scalars or sequences of length equal to the number of bars.
2763+
This enables you to use bar as the basis for stacked bar charts, or
2764+
candlestick plots.
27672765
27682766
Optional kwargs:
27692767
%(Rectangle)s
@@ -2924,14 +2922,12 @@ def make_iterable(x):
29242922

29252923
def barh(self, bottom, width, height=0.8, left=None, **kwargs):
29262924
"""
2927-
BARH(bottom, width, height=0.8, left=0,
2928-
color=None, edgecolor=None, linewidth=None,
2929-
xerr=None, yerr=None, ecolor=None, capsize=3,
2930-
align='edge', log=False)
2925+
BARH(bottom, width, height=0.8, left=0, **kwargs)
29312926
29322927
Make a horizontal bar plot with rectangles bounded by
29332928
2934-
left, left+width, bottom, bottom+height (left, right, bottom and top edges)
2929+
left, left+width, bottom, bottom+height
2930+
(left, right, bottom and top edges)
29352931
29362932
bottom, width, height, and left can be either scalars or sequences
29372933
@@ -2941,42 +2937,51 @@ def barh(self, bottom, width, height=0.8, left=None, **kwargs):
29412937
29422938
width - the lengths of the bars
29432939
2944-
Optional arguments
2940+
Optional arguments:
29452941
29462942
height - the heights (thicknesses) of the bars
29472943
29482944
left - the x coordinates of the left edges of the bars
29492945
2950-
color specifies the colors of the bars
2946+
color - the colors of the bars
29512947
2952-
edgecolor specifies the colors of the bar edges
2948+
edgecolor - the colors of the bar edges
2949+
2950+
linewidth - width of bar edges; None means use default
2951+
linewidth; 0 means don't draw edges.
29532952
29542953
xerr and yerr, if not None, will be used to generate errorbars
29552954
on the bar chart
29562955
29572956
ecolor specifies the color of any errorbar
29582957
2959-
capsize determines the length in points of the error bar caps
2958+
capsize (default 3) determines the length in points of the error
2959+
bar caps
29602960
2961-
align = 'edge' | 'center'
2962-
'edge' aligns the horizontal bars by their bottom edges in bottom, while
2963-
'center' interprets these values as the y coordinates of the bar centers.
2961+
align = 'edge' (default) | 'center'
29642962
29652963
log = False | True - False (default) leaves the horizontal
29662964
axis as-is; True sets it to log scale
29672965
2968-
The optional arguments color, edgecolor, linewidth, xerr, and
2969-
yerr can be either scalars or sequences of length equal to the
2970-
number of bars.
2966+
Setting align='edge' aligns bars by their bottom edges in bottom,
2967+
while 'center' interprets these values as the y coordinates of the bar
2968+
centers.
2969+
2970+
The optional arguments color, edgecolor, linewidth, xerr, and yerr can
2971+
be either scalars or sequences of length equal to the number of bars.
2972+
This enables you to use barh as the basis for stacked bar charts, or
2973+
candlestick plots.
29712974
2972-
This enables you to use barh as the basis for stacked bar
2973-
charts, or candlestick plots.
2975+
Optional kwargs:
2976+
%(Rectangle)s
29742977
"""
29752978

29762979
patches = self.bar(left=left, height=height, width=width, bottom=bottom,
29772980
orientation='horizontal', **kwargs)
29782981
return patches
29792982

2983+
barh.__doc__ = dedent(barh.__doc__) % artist.kwdocd
2984+
29802985
def broken_barh(self, xranges, yrange, **kwargs):
29812986
"""
29822987
A collection of horizontal bars spanning yrange with a sequence of

0 commit comments

Comments
 (0)