File wellmet/qt_gui/qt_graph_widgets.py changed (mode: 100644) (index 5b39c2f..f6d6b33) |
... |
... |
class ErrorGraph(pg.PlotWidget): |
303 |
303 |
self.setLogMode(y=True) |
self.setLogMode(y=True) |
304 |
304 |
|
|
305 |
305 |
pen = pg.mkPen(color='m', width=2) |
pen = pg.mkPen(color='m', width=2) |
306 |
|
self.pen_vertex = self.plot(x, y, pen=pen, name="simple pf estimation") |
|
307 |
|
pen = pg.mkPen(color='r', width=2) |
|
308 |
|
self.pen_weighted_vertex = self.plot(x, y, pen=pen, name="weighted pf estimation") |
|
|
306 |
|
self.pen_over = self.plot(x, y, pen=pen, name="pf overestimation") |
|
307 |
|
pen = pg.mkPen(color='r', width=2) #(118, 187, 255) |
|
308 |
|
self.pen_pf = self.plot(x, y, pen=pen, name="pf estimation") |
|
309 |
|
pen = pg.mkPen(color='darkMagenta', width=2) #(118, 187, 255) |
|
310 |
|
self.pen_under = self.plot(x, y, pen=pen, name="pf underestimation") |
309 |
311 |
|
|
310 |
312 |
|
|
311 |
313 |
def redraw(self, df): |
def redraw(self, df): |
|
... |
... |
class ErrorGraph(pg.PlotWidget): |
319 |
321 |
|
|
320 |
322 |
if 'vertex_estimation' in df: |
if 'vertex_estimation' in df: |
321 |
323 |
v = (df['vertex_estimation'] - self.pf_exact).abs() |
v = (df['vertex_estimation'] - self.pf_exact).abs() |
322 |
|
self.pen_vertex.setData(v.index.to_numpy(), v.to_numpy()) |
|
|
324 |
|
self.pen_pf.setData(v.index.to_numpy(), v.to_numpy()) |
323 |
325 |
if 'weighted_vertex_estimation' in df: |
if 'weighted_vertex_estimation' in df: |
324 |
326 |
wv = (df['weighted_vertex_estimation'] - self.pf_exact).abs() |
wv = (df['weighted_vertex_estimation'] - self.pf_exact).abs() |
325 |
|
self.pen_weighted_vertex.setData(wv.index.to_numpy(), wv.to_numpy()) |
|
|
327 |
|
self.pen_under.setData(wv.index.to_numpy(), wv.to_numpy()) |
326 |
328 |
|
|
327 |
329 |
xmax = df.index.max() |
xmax = df.index.max() |
328 |
330 |
self.update_xrange(xmax*1.02) |
self.update_xrange(xmax*1.02) |
|
... |
... |
class EstimationGraph(pg.PlotWidget): |
448 |
450 |
self.pen_mixed = self.plot(x, y, pen=pen, name="mixed probability") |
self.pen_mixed = self.plot(x, y, pen=pen, name="mixed probability") |
449 |
451 |
|
|
450 |
452 |
pen = pg.mkPen(color='m', width=2) |
pen = pg.mkPen(color='m', width=2) |
451 |
|
self.pen_vertex = self.plot(x, y, pen=pen, name="simple pf estimation") |
|
|
453 |
|
self.pen_over = self.plot(x, y, pen=pen, name="pf overestimation") |
452 |
454 |
pen = pg.mkPen(color='r', width=2) #(118, 187, 255) |
pen = pg.mkPen(color='r', width=2) #(118, 187, 255) |
453 |
|
self.pen_weighted_vertex = self.plot(x, y, pen=pen, name="weighted pf estimation") |
|
|
455 |
|
self.pen_pf = self.plot(x, y, pen=pen, name="pf estimation") |
|
456 |
|
pen = pg.mkPen(color='darkMagenta', width=2) #(118, 187, 255) |
|
457 |
|
self.pen_under = self.plot(x, y, pen=pen, name="pf underestimation") |
454 |
458 |
|
|
455 |
459 |
|
|
456 |
460 |
def replot(self, *args, **kwargs): |
def replot(self, *args, **kwargs): |
|
... |
... |
class EstimationGraph(pg.PlotWidget): |
490 |
494 |
if len(df) < 2: #č nevím proč hazí chyby. Asi kvůli zadané širce. |
if len(df) < 2: #č nevím proč hazí chyby. Asi kvůli zadané širce. |
491 |
495 |
return |
return |
492 |
496 |
|
|
|
497 |
|
if 'vertex_ratio_estimation' in df: |
|
498 |
|
self._set_data(self.pen_over, df['vertex_ratio_estimation']) |
|
499 |
|
|
493 |
500 |
if 'vertex_estimation' in df: |
if 'vertex_estimation' in df: |
494 |
|
self._set_data(self.pen_vertex, df['vertex_estimation']) |
|
|
501 |
|
self._set_data(self.pen_pf, df['vertex_estimation']) |
495 |
502 |
|
|
496 |
503 |
if 'weighted_vertex_estimation' in df: |
if 'weighted_vertex_estimation' in df: |
497 |
|
self._set_data(self.pen_weighted_vertex, df['weighted_vertex_estimation']) |
|
|
504 |
|
self._set_data(self.pen_under, df['weighted_vertex_estimation']) |
|
505 |
|
if 'weighted_ratio_estimation' in df: |
|
506 |
|
self._set_data(self.pen_under, df['weighted_ratio_estimation']) |
498 |
507 |
|
|
499 |
508 |
self._set_data(self.pen_outside, df.outside) |
self._set_data(self.pen_outside, df.outside) |
500 |
509 |
self._set_data(self.pen_mixed, df.mix) |
self._set_data(self.pen_mixed, df.mix) |