Figure out which subplotspecs this colorbar belongs to. Parameters ---------- cbax : `~matplotlib.axes.Axes` Axes for the colorbar.
(cbax)
| 590 | |
| 591 | |
| 592 | def get_cb_parent_spans(cbax): |
| 593 | """ |
| 594 | Figure out which subplotspecs this colorbar belongs to. |
| 595 | |
| 596 | Parameters |
| 597 | ---------- |
| 598 | cbax : `~matplotlib.axes.Axes` |
| 599 | Axes for the colorbar. |
| 600 | """ |
| 601 | rowstart = np.inf |
| 602 | rowstop = -np.inf |
| 603 | colstart = np.inf |
| 604 | colstop = -np.inf |
| 605 | for parent in cbax._colorbar_info['parents']: |
| 606 | ss = parent.get_subplotspec() |
| 607 | rowstart = min(ss.rowspan.start, rowstart) |
| 608 | rowstop = max(ss.rowspan.stop, rowstop) |
| 609 | colstart = min(ss.colspan.start, colstart) |
| 610 | colstop = max(ss.colspan.stop, colstop) |
| 611 | |
| 612 | rowspan = range(rowstart, rowstop) |
| 613 | colspan = range(colstart, colstop) |
| 614 | return rowspan, colspan |
| 615 | |
| 616 | |
| 617 | def get_pos_and_bbox(ax, renderer): |
no test coverage detected
searching dependent graphs…