Define which axes have tick labels. Parameters ---------- mode : {"L", "1", "all", "keep"} The label mode: - "L": All axes on the left column get vertical tick labels; all axes on the bottom row get horizontal tick labels.
(self, mode)
| 238 | return self._divider.get_aspect() |
| 239 | |
| 240 | def set_label_mode(self, mode): |
| 241 | """ |
| 242 | Define which axes have tick labels. |
| 243 | |
| 244 | Parameters |
| 245 | ---------- |
| 246 | mode : {"L", "1", "all", "keep"} |
| 247 | The label mode: |
| 248 | |
| 249 | - "L": All axes on the left column get vertical tick labels; |
| 250 | all axes on the bottom row get horizontal tick labels. |
| 251 | - "1": Only the bottom left axes is labelled. |
| 252 | - "all": All axes are labelled. |
| 253 | - "keep": Do not do anything. |
| 254 | """ |
| 255 | _api.check_in_list(["all", "L", "1", "keep"], mode=mode) |
| 256 | if mode == "keep": |
| 257 | return |
| 258 | for i, j in np.ndindex(self._nrows, self._ncols): |
| 259 | try: |
| 260 | ax = self.axes_row[i][j] |
| 261 | except IndexError: |
| 262 | continue |
| 263 | if isinstance(ax.axis, MethodType): |
| 264 | bottom_axis = SimpleAxisArtist(ax.xaxis, 1, ax.spines["bottom"]) |
| 265 | left_axis = SimpleAxisArtist(ax.yaxis, 1, ax.spines["left"]) |
| 266 | else: |
| 267 | bottom_axis = ax.axis["bottom"] |
| 268 | left_axis = ax.axis["left"] |
| 269 | display_at_bottom = (i == self._nrows - 1 if mode == "L" else |
| 270 | i == self._nrows - 1 and j == 0 if mode == "1" else |
| 271 | True) # if mode == "all" |
| 272 | display_at_left = (j == 0 if mode == "L" else |
| 273 | i == self._nrows - 1 and j == 0 if mode == "1" else |
| 274 | True) # if mode == "all" |
| 275 | bottom_axis.toggle(ticklabels=display_at_bottom, label=display_at_bottom) |
| 276 | left_axis.toggle(ticklabels=display_at_left, label=display_at_left) |
| 277 | |
| 278 | def get_divider(self): |
| 279 | return self._divider |
no test coverage detected