From 640d5147a059d1c93b41265b14c2e7e401bac9c4 Mon Sep 17 00:00:00 2001 From: jakakokosar Date: Wed, 10 Mar 2021 17:15:51 +0100 Subject: [PATCH] owkaplanmeier: change the symbol of censored data --- .../survival_analysis/widgets/owkaplanmeier.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/orangecontrib/survival_analysis/widgets/owkaplanmeier.py b/orangecontrib/survival_analysis/widgets/owkaplanmeier.py index d861877..5ebef74 100644 --- a/orangecontrib/survival_analysis/widgets/owkaplanmeier.py +++ b/orangecontrib/survival_analysis/widgets/owkaplanmeier.py @@ -5,7 +5,7 @@ from itertools import zip_longest from xml.sax.saxutils import escape -from AnyQt.QtGui import QBrush, QColor +from AnyQt.QtGui import QBrush, QColor, QPainterPath from AnyQt.QtCore import Qt, QSize from AnyQt.QtCore import pyqtSignal as Signal from pyqtgraph.functions import mkPen @@ -27,6 +27,13 @@ HORIZONTAL_LINE = pg.InfiniteLine(pos=0.5, angle=0, pen=MEDIAN_LINE_PEN) +def create_line_symbol(): + p = QPainterPath() + p.moveTo(0, 0) + p.lineTo(0, -1) + return p + + class EstimatedFunctionCurve: @staticmethod def generate_curve_coordinates(timeline, probabilities): @@ -71,7 +78,8 @@ def __init__(self, time, events, label=None, color=None): y=censored_data[:, 1], brush=QBrush(Qt.black), pen=self.get_pen(width=1, alpha=255), - # size=np.full((points.shape[0],), 10.1), + symbol=create_line_symbol(), + size=15, ) self.censored_data.setZValue(10)