def add_mask(self, x_min, x_max, y_min, y_max, name = None, is_inclusive = True, shape = 'r'): x = min(x_min, x_max) y = min(y_min, y_max) width = abs(x_max - x_min) height = abs(y_max - y_min) if shape is None or not shape[0].lower() == 'e' : mask = RectangleMask(is_inclusive, x, y, width, height) else : mask = EllipseMask(is_inclusive, x, y, width, height) if not name is None : mask.setName(name) self.pv.getPlot().addMask(mask) self.pv.getPlot().repaint() return mask
def add_mask_2d(self, x_min, x_max, y_min, y_max, name = None, is_inclusive = True, shape = 'r'): x = min(x_min, x_max) y = min(y_min, y_max) width = abs(x_max - x_min) height = abs(y_max - y_min) if shape is None or not shape[0].lower() == 'e' : mask = RectangleMask(is_inclusive, x, y, width, height) else : mask = EllipseMask(is_inclusive, x, y, width, height) if not name is None : mask.setName(name) if not hasattr(self.cache, "masks") : self.masks = [] self.masks.append(mask) return mask
def add_mask(self, x_min, x_max, y_min, y_max, name=None, is_inclusive=True, shape='r'): x = min(x_min, x_max) y = min(y_min, y_max) width = abs(x_max - x_min) height = abs(y_max - y_min) if shape is None or not shape[0].lower() == 'e': mask = RectangleMask(is_inclusive, x, y, width, height) else: mask = EllipseMask(is_inclusive, x, y, width, height) if not name is None: mask.setName(name) self.pv.getPlot().addMask(mask) self.pv.getPlot().repaint() return mask