def bar(self, height='<STR_LIT>', sort=False, reverse=False,<EOL>legend=None, ax=None, figsize=None, **kwargs):
if sort:<EOL><INDENT>if sort is True:<EOL><INDENT>def func(x): return x.thickness<EOL>reverse = True<EOL><DEDENT>data = sorted(self, key=func, reverse=reverse)<EOL><DEDENT>else:<EOL><INDENT>data = self[:]<EOL><DEDENT>if ax is None:<EOL><INDENT>fig, ax = plt.subplots(figsize=figsize)<EOL><DEDENT>heights = [getattr(i, height) for i in data]<EOL>comps = [i[<NUM_LIT:0>] for i in self.unique]<EOL>if legend is None:<EOL><INDENT>legend = Legend.random(comps)<EOL><DEDENT>colors = [legend.get_colour(i.primary) for i in data]<EOL>bars = ax.bar(range(len(data)), height=heights, color=colors, **kwargs)<EOL>colourables = [i.primary.summary() for i in data]<EOL>unique_bars = dict(zip(colourables, bars))<EOL>ax.legend(unique_bars.values(), unique_bars.keys())<EOL>ax.set_ylabel(height.title())<EOL>return ax<EOL>
Make a bar plot of thickness per interval.

Args:
    height (str): The property of the primary component to plot.
    sort (bool or function): Either pass a boolean indicating whether
        to reverse sort by thickness, or pass a function to be used as
        the sort key.
    reverse (bool): Reverses the sort order.
    legend (Legend): The legend to plot with.
    ax (axis): Optional axis to plot to.
    figsize (tuple): A figure size, (width, height), optional.
    **kwargs: passed to the matplotlib bar plot command, ax.bar().

Returns:
    axis: If you sent an axis in, you get it back.