docs: def bar(h1: Histogram1D, ax: Axes, *, errors: bool = False, **kwargs):
      """Bar plot of 1D histograms."""
      show_stats = kwargs.pop("show_stats", False)
      show_values = kwargs.pop("show_values", False)
      value_format = kwargs.pop("value_format", None)
      density = kwargs.pop("density", False)
      cumulative = kwargs.pop("cumulative", False)
      label = kwargs.pop("label", h1.name)
      lw = kwargs.pop("linewidth", kwargs.pop("lw", 0.5))
      text_kwargs = pop_kwargs_with_prefix("text_", kwargs)
  
      data = get_data(h1, cumulative=cumulative, density=density)
  
      if "cmap" in kwargs:
          cmap = _get_cmap(kwargs)
          _, cmap_data = _get_cmap_data(data, kwargs)
          colors = cmap(cmap_data)
      else:
          colors = kwargs.pop("color", None)
  
      _apply_xy_lims(ax, h1, data, kwargs)
      _add_ticks(ax, h1, kwargs)
  
      if errors:
          err_data = get_err_data(h1, cumulative=cumulative, density=density)
          kwargs["yerr"] = err_data
          if "ecolor" not in kwargs:
              kwargs["ecolor"] = "black"
  
      _add_labels(ax, h1, kwargs)
      ax.bar(h1.bin_left_edges, data, h1.bin_widths, align="edge",
             label=label, color=colors, linewidth=lw, **kwargs)
  
      if show_values:
          _add_values(ax, h1, data, value_format=value_format, **text_kwargs)
      if show_stats:
          _add_stats_box(h1, ax, stats=show_stats)