MCPcopy Index your code
hub / github.com/pydata/xarray / _add_colorbar

Function _add_colorbar

xarray/plot/utils.py:736–750  ·  view source on GitHub ↗
(primitive, ax, cbar_ax, cbar_kwargs, cmap_params)

Source from the content-addressed store, hash-verified

734
735
736def _add_colorbar(primitive, ax, cbar_ax, cbar_kwargs, cmap_params):
737 cbar_kwargs.setdefault("extend", cmap_params["extend"])
738 if cbar_ax is None:
739 cbar_kwargs.setdefault("ax", ax)
740 else:
741 cbar_kwargs.setdefault("cax", cbar_ax)
742
743 # dont pass extend as kwarg if it is in the mappable
744 if hasattr(primitive, "extend"):
745 cbar_kwargs.pop("extend")
746
747 fig = ax.get_figure()
748 cbar = fig.colorbar(primitive, **cbar_kwargs)
749
750 return cbar
751
752
753def _rescale_imshow_rgb(darray, vmin, vmax, robust):

Callers 2

newplotfuncFunction · 0.90
newplotfuncFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…