Refactor colorbar() function outside of Plot or Axes
This PR refactors the colorbar()
creation function to be outside of both the Plot
and Axes
classes, but called from the .colorbar()
methods of both.
This is mainly to support calling ax.colorbar()
from Axes
that are attached to a Figure
(the superclass of Plot
), rather than a Plot
. Fixes #1736.