def get_selected_data(axes, x1, y1, x2, y2): """ Verifies that the axes in question overlaps with the canvas area from C{(x1, y1)} to C{(x1, y1)}. The corresponding X and Y axes ranges are returned as a 3-tuple. If no axes overlaps with the specified area, 2-tuple of C{None}s is returned. """ if axes is None: return None, None bbox = bound_vertices([(x1, y1), (x2, y2)]) bxr, byr = wxmpl.get_bbox_lims(bbox) axr, ayr = wxmpl.get_bbox_lims(axes.bbox) xmin = max(bxr[0], axr[0]) xmax = min(bxr[1], axr[1]) ymin = max(byr[0], ayr[0]) ymax = min(byr[1], ayr[1]) return wxmpl.get_bbox_lims( inverse_transform_bbox(axes.transData, bound_vertices([(xmin, ymin), (xmax, ymax)])))
def get_window_extent(self, renderer=None): verts = self.get_verts() tverts = self.get_transform().seq_xy_tups(verts) return transforms.bound_vertices(tverts)