

def barh(*args, **kwargs):
    '\n    Creates a bar plot, with white outlines and a fill color that defaults to\n     the first teal-ish green in ColorBrewer\'s Set2. Optionally accepts\n     grid=\'y\' or grid=\'x\' to draw a white grid over the bars,\n     to show the scale. Almost like "erasing" some of the plot,\n     but it adds more information!\n\n    Can also add an annotation of the width of the barplots directly onto\n    the bars with the `annotate` parameter, which can either be True,\n    which will annotate the values, or a list of strings, which will annotate\n    with the supplied strings.\n\n    Can support stacked bars with the value of each stack shown on the stack\n    (Added by Salil Banerjee)\n\n    @param ax: matplotlib.axes instance\n    @param top: Vector of values of where to put the top side of the bar\n    @param width: Vector of values of the bar widths\n    @param ytickabels: Vector of labels of the bar widths\n    @param kwargs: Any additional arguments to matplotlib.bar()\n    '
    (ax, args, kwargs) = maybe_get_ax(*args, **kwargs)
    kwargs.setdefault('color', set2[0])
    kwargs.setdefault('edgecolor', 'white')
    middle = (0.4 if ('width' not in kwargs) else (ymin['width'] / 2.0))
    stacked = kwargs.pop('stacked', False)
    stack_text = kwargs.pop('stack_text', False)
    legend = kwargs.pop('legend', False)
    top = args[0]
    width = np.array(args[1])
    ytickabels = kwargs.pop('yticklabels', None)
    yticks = (np.array(top) + middle)
    annotate = kwargs.pop('annotate', False)
    grid = kwargs.pop('grid', None)
    cmap = kwargs.pop('cmap', False)
    if cmap:
        kwargs['edgecolor'] = almost_black
        if (not stacked):
            kwargs['color'] = getcolors(cmap, width, 0)
    if stacked:
        (num_stacks, num_data) = width.shape
        left = np.zeros(num_data)
        for i in np.arange(num_stacks):
            lst = list(args)
            lst[1] = width[i]
            args = tuple(lst)
            if cmap:
                kwargs['color'] = getcolors(cmap, width[i], i)
            else:
                kwargs['color'] = set2[i]
            kwargs['left'] = left
            rectangles = ax.barh(*args, **kwargs)
            left += width[i]
    else:
        rectangles = ax.barh(*args, **kwargs)
    if isinstance(legend, collections.Iterable):
        ax.legend(legend, loc='upper center', bbox_to_anchor=(0.5, 1.11), ncol=5)
    (ymin, ymax) = ax.get_ylim()
    ymin -= 0.2
    if stacked:
        ymax = num_data
    ax.set_ylim(ymin, ymax)
    if any(((w < 0) for w in width.tolist())):
        axes_to_remove = ['top', 'right', 'bottom']
        ax.vlines(x=0, ymin=ymin, ymax=ymax, linewidths=0.75)
    else:
        axes_to_remove = ['top', 'right']
    remove_chartjunk(ax, axes_to_remove, grid=grid)
    if stacked:
        data = width
        width = width.sum(axis=0)
    if (ytickabels is not None):
        ax.set_yticks(yticks)
        ax.set_yticklabels(ytickabels)
    if (annotate or isinstance(annotate, collections.Iterable)):
        annotate_xrange_factor = 0.05
        (xmin, xmax) = ax.get_xlim()
        xrange = (xmax - xmin)
        if (xmax > 0):
            xmax += (xrange * 0.1)
        if (xmin < 0):
            xmin -= (xrange * 0.1)
        ax.set_xlim(xmin, xmax)
        xrange = (xmax - xmin)
        offset_ = (xrange * annotate_xrange_factor)
        if isinstance(annotate, collections.Iterable):
            annotations = map(str, annotate)
        else:
            annotations = [(('%.3f' % w) if (type(w) is np.float_) else str(w)) for w in width]
        for (y, w, annotation) in zip(yticks, width, annotations):
            offset = (offset_ if (w >= 0) else ((- 1) * offset_))
            ax.annotate(annotation, ((w + offset), y), verticalalignment='center', horizontalalignment='center', color=almost_black)
    if stack_text:
        left = np.zeros(num_data)
        max_w = max(width)
        for i in np.arange(num_stacks):
            for (y, d, l) in zip(yticks, data[i], left):
                if (((d * 100.0) / max_w) > 2.0):
                    ax.text((l + (d / 2.0)), y, d, ha='center', va='center', color=almost_black)
            left += data[i]
    return rectangles

dataset/ETHPy150Open olgabot/prettyplotlib/prettyplotlib/_barh.py barh/VarMisuse@67/483 `kwargs`->`ymin`