File qt_plot.py changed (mode: 100644) (index 7a5fe07..5d34fb8) |
... |
... |
class QtGuiPlot2D(QtGui.QMainWindow): |
49 |
49 |
#E former self.w = QtGui.QMainWindow() |
#E former self.w = QtGui.QMainWindow() |
50 |
50 |
self.app = pg.mkQApp() |
self.app = pg.mkQApp() |
51 |
51 |
super().__init__() |
super().__init__() |
52 |
|
self.setWindowTitle("%sD: %s" %(sample_box.nvar, sample_box.gm_signature)) |
|
|
52 |
|
try: |
|
53 |
|
self.setWindowTitle("%sD: %s" %(sample_box.nvar, sample_box.gm_signature)) |
|
54 |
|
except: |
|
55 |
|
self.setWindowTitle("%sD nodes" % sample_box.nvar) |
53 |
56 |
|
|
54 |
57 |
# for debug |
# for debug |
55 |
58 |
# container for errors |
# container for errors |
|
... |
... |
E Drawing items |
388 |
391 |
""" |
""" |
389 |
392 |
|
|
390 |
393 |
|
|
391 |
|
|
|
392 |
|
#class Serie: |
|
393 |
|
# def __init__(self, sample, w, **plot_kwargs): |
|
394 |
|
# self.sample = sample |
|
395 |
|
# self.w = w |
|
396 |
|
# self.plot_kwargs = plot_kwargs |
|
397 |
|
# |
|
398 |
|
# self._draw() |
|
399 |
|
# |
|
400 |
|
# def _draw(self): |
|
401 |
|
# pos = getattr(self.sample, self.w.space)[:,:2] |
|
402 |
|
# mask = np.all(np.isfinite(pos), axis=1) |
|
403 |
|
# self.plot_item = w.central_widget.plot(pos[mask], **plot_kwargs) |
|
404 |
|
|
|
405 |
|
|
|
406 |
394 |
class Series: |
class Series: |
407 |
395 |
def __init__(self, w, autoredraw=True): |
def __init__(self, w, autoredraw=True): |
408 |
396 |
self.w = w |
self.w = w |
|
... |
... |
class BasePlotting: |
585 |
573 |
symbolSize=size, symbolBrush=(119,172,48), name='Proxy successes') |
symbolSize=size, symbolBrush=(119,172,48), name='Proxy successes') |
586 |
574 |
self.proxy_successes.setZValue(85) |
self.proxy_successes.setZValue(85) |
587 |
575 |
|
|
|
576 |
|
|
|
577 |
|
self.nodes = plot_widget.plot(pos, pen=None, symbol='o', symbolPen=0.5, \ |
|
578 |
|
symbolSize=size, name='Nodes') |
|
579 |
|
self.nodes.setZValue(80) |
|
580 |
|
|
588 |
581 |
self.plot() |
self.plot() |
589 |
582 |
|
|
590 |
583 |
def plot(self): |
def plot(self): |
|
... |
... |
class BasePlotting: |
593 |
586 |
sample_box = self.w.sample_box[:nsim] |
sample_box = self.w.sample_box[:nsim] |
594 |
587 |
|
|
595 |
588 |
pos = getattr(sample_box, self.w.space)[:,:2] |
pos = getattr(sample_box, self.w.space)[:,:2] |
596 |
|
failsi = sample_box.failsi |
|
597 |
|
|
|
598 |
|
try: # proxy denotes to implicitly-known values |
|
599 |
|
proxy = sample_box.proxy |
|
600 |
|
except AttributeError: |
|
601 |
|
proxy = np.full(nsim, False, dtype=np.bool) |
|
602 |
|
|
|
603 |
|
mask = np.all((failsi, ~proxy), axis=0) |
|
604 |
|
self.draw(self.failures, pos[mask]) |
|
605 |
|
|
|
606 |
|
mask = np.all((~failsi, ~proxy), axis=0) |
|
607 |
|
self.draw(self.successes, pos[mask]) |
|
608 |
|
|
|
609 |
|
mask = np.all((failsi, proxy), axis=0) |
|
610 |
|
self.draw(self.proxy_failures, pos[mask]) |
|
611 |
|
|
|
612 |
|
mask = np.all((~failsi, proxy), axis=0) |
|
613 |
|
self.draw(self.proxy_successes, pos[mask]) |
|
|
589 |
|
if hasattr(sample_box, 'failsi'): #č to je normálně sample_box |
|
590 |
|
failsi = sample_box.failsi |
|
591 |
|
|
|
592 |
|
try: # proxy denotes to implicitly-known values |
|
593 |
|
proxy = sample_box.proxy |
|
594 |
|
except AttributeError: |
|
595 |
|
proxy = np.full(nsim, False, dtype=np.bool) |
|
596 |
|
|
|
597 |
|
mask = np.all((failsi, ~proxy), axis=0) |
|
598 |
|
self.draw(self.failures, pos[mask]) |
|
599 |
|
|
|
600 |
|
mask = np.all((~failsi, ~proxy), axis=0) |
|
601 |
|
self.draw(self.successes, pos[mask]) |
|
602 |
|
|
|
603 |
|
mask = np.all((failsi, proxy), axis=0) |
|
604 |
|
self.draw(self.proxy_failures, pos[mask]) |
|
605 |
|
|
|
606 |
|
mask = np.all((~failsi, proxy), axis=0) |
|
607 |
|
self.draw(self.proxy_successes, pos[mask]) |
|
608 |
|
|
|
609 |
|
else: #č není to teda sample_box... |
|
610 |
|
#č snad se nám povede nakreslit aspoň tečky? |
|
611 |
|
self.draw(self.nodes, pos) |
614 |
612 |
|
|
615 |
613 |
|
|
616 |
614 |
@staticmethod |
@staticmethod |