Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ENH] owkaplanmeier: change the symbol of censored data #13

Merged
merged 1 commit into from
Mar 12, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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, 0)
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=15,
)
self.censored_data.setZValue(10)

Expand Down