Remove this colorbar from the figure. If the colorbar was created with ``use_gridspec=True`` the previous gridspec is restored.
(self)
| 1040 | self.long_axis._set_axes_scale(scale, **kwargs) |
| 1041 | |
| 1042 | def remove(self): |
| 1043 | """ |
| 1044 | Remove this colorbar from the figure. |
| 1045 | |
| 1046 | If the colorbar was created with ``use_gridspec=True`` the previous |
| 1047 | gridspec is restored. |
| 1048 | """ |
| 1049 | if hasattr(self.ax, '_colorbar_info'): |
| 1050 | parents = self.ax._colorbar_info['parents'] |
| 1051 | for a in parents: |
| 1052 | if self.ax in a._colorbars: |
| 1053 | a._colorbars.remove(self.ax) |
| 1054 | |
| 1055 | self._ax_remove(self.ax) |
| 1056 | |
| 1057 | self.mappable.callbacks.disconnect(self.mappable.colorbar_cid) |
| 1058 | self.mappable.colorbar = None |
| 1059 | self.mappable.colorbar_cid = None |
| 1060 | # Remove the extension callbacks |
| 1061 | self.ax.callbacks.disconnect(self._extend_cid1) |
| 1062 | self.ax.callbacks.disconnect(self._extend_cid2) |
| 1063 | |
| 1064 | try: |
| 1065 | ax = self.mappable.axes |
| 1066 | except AttributeError: |
| 1067 | return |
| 1068 | try: |
| 1069 | subplotspec = self.ax.get_subplotspec().get_gridspec()._subplot_spec |
| 1070 | except AttributeError: # use_gridspec was False |
| 1071 | pos = ax.get_position(original=True) |
| 1072 | ax._set_position(pos) |
| 1073 | else: # use_gridspec was True |
| 1074 | ax.set_subplotspec(subplotspec) |
| 1075 | |
| 1076 | def _process_values(self): |
| 1077 | """ |
no test coverage detected