Skip to content

Commit

Permalink
owkaplanmeier: change the symbol of censored data
Browse files Browse the repository at this point in the history
  • Loading branch information
JakaKokosar committed Mar 10, 2021
1 parent 0e183ce commit 0d451d6
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions orangecontrib/survival_analysis/widgets/owkaplanmeier.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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, -1)
p.lineTo(0, 1)
return p


class EstimatedFunctionCurve:
@staticmethod
def generate_curve_coordinates(timeline, probabilities):
Expand Down Expand Up @@ -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=10,
)
self.censored_data.setZValue(10)

Expand Down

0 comments on commit 0d451d6

Please sign in to comment.