def _data_from_bar(ax, bar_label):
    """Given a matplotlib Axes object and a bar label,
    returns (x,y,w,h) data underlying the bar plot.

    Args:
        ax: The Axes object the data will be extracted from.
        bar_label: The bar label from which you want to extract the data.

    Returns:
        A list of (x,y,w,h) for this bar.

    """
    data = []
    handles = ax.get_legend_handles_labels()
    bar_artists = handles[0][handles[1].index(bar_label)]
    for rectangle in bar_artists:
        data.append([rectangle.get_x(), rectangle.get_y(), rectangle.
            get_width(), rectangle.get_height()])
    return data
