MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / colorbar

Function colorbar

lib/matplotlib/pyplot.py:2669–2683  ·  view source on GitHub ↗
(
    mappable: ScalarMappable | ColorizingArtist | None = None,
    cax: matplotlib.axes.Axes | None = None,
    ax: matplotlib.axes.Axes | Iterable[matplotlib.axes.Axes] | None = None,
    **kwargs
)

Source from the content-addressed store, hash-verified

2667
2668@_copy_docstring_and_deprecators(Figure.colorbar)
2669def colorbar(
2670 mappable: ScalarMappable | ColorizingArtist | None = None,
2671 cax: matplotlib.axes.Axes | None = None,
2672 ax: matplotlib.axes.Axes | Iterable[matplotlib.axes.Axes] | None = None,
2673 **kwargs
2674) -> Colorbar:
2675 if mappable is None:
2676 mappable = gci()
2677 if mappable is None:
2678 raise RuntimeError('No mappable was found to use for colorbar '
2679 'creation. First define a mappable such as '
2680 'an image (with imshow) or a contour set ('
2681 'with contourf).')
2682 ret = gcf().colorbar(mappable, cax=cax, ax=ax, **kwargs)
2683 return ret
2684
2685
2686def clim(vmin: float | None = None, vmax: float | None = None) -> None:

Callers

nothing calls this directly

Calls 3

gciFunction · 0.85
gcfFunction · 0.85
colorbarMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…