(self, ax, renderer)
| 155 | self._orig_locator = cbar.ax._axes_locator |
| 156 | |
| 157 | def __call__(self, ax, renderer): |
| 158 | if self._orig_locator is not None: |
| 159 | pos = self._orig_locator(ax, renderer) |
| 160 | else: |
| 161 | pos = ax.get_position(original=True) |
| 162 | if self._cbar.extend == 'neither': |
| 163 | return pos |
| 164 | |
| 165 | y, extendlen = self._cbar._proportional_y() |
| 166 | if not self._cbar._extend_lower(): |
| 167 | extendlen[0] = 0 |
| 168 | if not self._cbar._extend_upper(): |
| 169 | extendlen[1] = 0 |
| 170 | len = sum(extendlen) + 1 |
| 171 | shrink = 1 / len |
| 172 | offset = extendlen[0] / len |
| 173 | # we need to reset the aspect ratio of the axes to account |
| 174 | # of the extends... |
| 175 | if hasattr(ax, '_colorbar_info'): |
| 176 | aspect = ax._colorbar_info['aspect'] |
| 177 | else: |
| 178 | aspect = False |
| 179 | # now shrink and/or offset to take into account the |
| 180 | # extend tri/rectangles. |
| 181 | if self._cbar.orientation == 'vertical': |
| 182 | if aspect: |
| 183 | self._cbar.ax.set_box_aspect(aspect*shrink) |
| 184 | pos = pos.shrunk(1, shrink).translated(0, offset * pos.height) |
| 185 | else: |
| 186 | if aspect: |
| 187 | self._cbar.ax.set_box_aspect(1/(aspect * shrink)) |
| 188 | pos = pos.shrunk(shrink, 1).translated(offset * pos.width, 0) |
| 189 | return pos |
| 190 | |
| 191 | def get_subplotspec(self): |
| 192 | # make tight_layout happy.. |
nothing calls this directly
no test coverage detected