def generate_pens(basecolor): pen = QPen(basecolor, 1) pen.setCosmetic(True) shadow_pen = QPen(pen.color().lighter(160), 2.5) shadow_pen.setCosmetic(True) return pen, shadow_pen
def plot_curves(self, target, clf_idx): if (target, clf_idx) not in self._curve_data: curve = liftCurve_from_results(self.results, clf_idx, target) color = self.colors[clf_idx] pen = QPen(color, 1) pen.setCosmetic(True) shadow_pen = QPen(pen.color().lighter(160), 2.5) shadow_pen.setCosmetic(True) item = pg.PlotDataItem( curve.points[0], curve.points[1], pen=pen, shadowPen=shadow_pen, symbol="+", symbolSize=3, symbolPen=shadow_pen, antialias=True, ) hull_item = pg.PlotDataItem(curve.hull[0], curve.hull[1], pen=pen, antialias=True) self._curve_data[target, clf_idx] = PlotCurve(curve, item, hull_item) return self._curve_data[target, clf_idx]
def __updateStyleState(self): """ Update the arrows' brush, pen, ... based on it's state """ if self.isSelected(): color = self.__color.darker(150) pen = QPen(QColor(96, 158, 215), Qt.DashDotLine) pen.setWidthF(1.25) pen.setCosmetic(True) self.__shadow.setColor(pen.color().darker(150)) else: color = self.__color pen = QPen(Qt.NoPen) self.__shadow.setColor(QColor(63, 63, 63, 180)) self.__arrowItem.setBrush(color) self.__arrowItem.setPen(pen)
def add_line(self, plot_area_i, line_i, values): color = self.colors[line_i] pen = QPen(color, 1) pen.setCosmetic(True) shadow_pen = QPen(pen.color().lighter(160), 2.5) shadow_pen.setCosmetic(True) line = pg.PlotDataItem(values['x'], values['y'], pen=pen, shadowPen=shadow_pen, symbol="+", symbolSize=3, symbolPen=shadow_pen, antialias=True) self.plot_items[plot_area_i].addItem(line)
def plot_curves(self, target, clf_idx): if (target, clf_idx) not in self._curve_data: curve = liftCurve_from_results(self.results, clf_idx, target) color = self.colors[clf_idx] pen = QPen(color, 1) pen.setCosmetic(True) shadow_pen = QPen(pen.color().lighter(160), 2.5) shadow_pen.setCosmetic(True) item = pg.PlotDataItem( curve.points[0], curve.points[1], pen=pen, shadowPen=shadow_pen, symbol="+", symbolSize=3, symbolPen=shadow_pen, antialias=True ) hull_item = pg.PlotDataItem( curve.hull[0], curve.hull[1], pen=pen, antialias=True ) self._curve_data[target, clf_idx] = \ PlotCurve(curve, item, hull_item) return self._curve_data[target, clf_idx]
def plot_curves(self, target, clf_idx): if (target, clf_idx) not in self._curve_data: curve = pvrCurve_from_results(self.results, clf_idx, target) color = self.colors[clf_idx] pen = QPen(color, 1) pen.setCosmetic(True) shadow_pen = QPen(pen.color().lighter(160), 2.5) shadow_pen.setCosmetic(True) item = pg.PlotDataItem(curve.points[0], curve.points[1], pen=pen, shadowPen=shadow_pen, symbol="+", symbolSize=3, symbolPen=shadow_pen, antialias=True) item_label = pg.TextItem(text="AP{:.3f}".format(curve[1]), color=color) item_label.setPos(0.1, 1 - (clf_idx / 10)) self._curve_data[target, clf_idx] = \ PlotCurve(curve, item, item_label) return self._curve_data[target, clf_idx]