Check that no Axes have collapsed to zero size.
(layoutgrids, fig)
| 246 | |
| 247 | |
| 248 | def check_no_collapsed_axes(layoutgrids, fig): |
| 249 | """ |
| 250 | Check that no Axes have collapsed to zero size. |
| 251 | """ |
| 252 | for sfig in fig.subfigs: |
| 253 | ok = check_no_collapsed_axes(layoutgrids, sfig) |
| 254 | if not ok: |
| 255 | return False |
| 256 | for ax in fig.axes: |
| 257 | gs = ax.get_gridspec() |
| 258 | if gs in layoutgrids: # also implies gs is not None. |
| 259 | lg = layoutgrids[gs] |
| 260 | for i in range(gs.nrows): |
| 261 | for j in range(gs.ncols): |
| 262 | bb = lg.get_inner_bbox(i, j) |
| 263 | if bb.width <= 0 or bb.height <= 0: |
| 264 | return False |
| 265 | return True |
| 266 | |
| 267 | |
| 268 | def compress_fixed_aspect(layoutgrids, fig): |
no test coverage detected
searching dependent graphs…