File qt_plot.py changed (mode: 100644) (index db9532e..43c1db8) |
... |
... |
class SimpleSimplexEstimationGraph(pg.PlotWidget): |
886 |
886 |
|
|
887 |
887 |
self.setup_context_menu() |
self.setup_context_menu() |
888 |
888 |
self.setup() |
self.setup() |
|
889 |
|
self.replot() |
889 |
890 |
|
|
890 |
891 |
def setup_context_menu(self): |
def setup_context_menu(self): |
891 |
892 |
# creates instance of LegendItem |
# creates instance of LegendItem |
|
... |
... |
class SimpleSimplexEstimationGraph(pg.PlotWidget): |
922 |
923 |
self.log_y_chk = QtGui.QAction("Log Y", self.custom_menu) |
self.log_y_chk = QtGui.QAction("Log Y", self.custom_menu) |
923 |
924 |
self.log_y_chk.setCheckable(True) |
self.log_y_chk.setCheckable(True) |
924 |
925 |
self.log_y_chk.setChecked(True) |
self.log_y_chk.setChecked(True) |
925 |
|
self.log_y_chk.triggered.connect(self.setup) |
|
|
926 |
|
self.log_y_chk.triggered.connect(self.replot) |
926 |
927 |
self.custom_menu.addAction(self.log_y_chk) |
self.custom_menu.addAction(self.log_y_chk) |
927 |
928 |
|
|
928 |
929 |
self.reaction = QtGui.QAction("Redraw", self.custom_menu) |
self.reaction = QtGui.QAction("Redraw", self.custom_menu) |
|
... |
... |
class SimpleSimplexEstimationGraph(pg.PlotWidget): |
949 |
950 |
self.setBackground('w') |
self.setBackground('w') |
950 |
951 |
x = y = () # zde jen vytvoříme kostru, nakrmime daty v .redraw() |
x = y = () # zde jen vytvoříme kostru, nakrmime daty v .redraw() |
951 |
952 |
|
|
952 |
|
if self.log_y_chk.isChecked(): |
|
953 |
|
self.setLogMode(y=True) |
|
954 |
|
#self.pen_f = self.plot(x, y, fillLevel=0, brush='r') # red |
|
955 |
|
pen = pg.mkPen(color=(255, 0, 0), width=3)#, style=QtCore.Qt.DashLine) |
|
956 |
|
self.pen_f = self.plot(x, y, pen=pen) # red |
|
957 |
|
self.pen_mix = self.plot(x, y, fillLevel=0, brush=(255, 165, 0)) # orange |
|
958 |
|
self.pen_outside = self.plot(x, y, fillLevel=0, brush=0.8) # grey |
|
959 |
|
self.pen_success = self.plot(x, y, fillLevel=0, brush='g') # green |
|
960 |
|
|
|
961 |
|
else: |
|
962 |
|
self.setLogMode(y=False) |
|
963 |
|
self.pen_success = self.plot(x, y, fillLevel=0, brush='g') # green |
|
964 |
|
self.pen_outside = self.plot(x, y, fillLevel=0, brush=0.8) # grey |
|
965 |
|
self.pen_mix = self.plot(x, y, fillLevel=0, brush=(255, 165, 0)) # orange |
|
966 |
|
self.pen_f = self.plot(x, y, fillLevel=0, brush='r') # red |
|
|
953 |
|
xkcd_green = (167, 255, 181) # xkcd:light seafoam green #a7ffb5 |
|
954 |
|
xkcd_red = (253, 193, 197) # xkcd: pale rose (#fdc1c5) |
|
955 |
|
xkcd_cream = (255, 243, 154) # let's try xkcd: dark cream (#fff39a) |
|
956 |
|
|
|
957 |
|
self.pen_success = self.plot(x, y, fillLevel=0, brush=xkcd_green) |
|
958 |
|
self.pen_outside = self.plot(x, y, fillLevel=0, brush=0.8) # grey |
|
959 |
|
self.pen_mix = self.plot(x, y, fillLevel=0, brush=xkcd_cream) |
|
960 |
|
self.pen_f = self.plot(x, y, fillLevel=0, brush=xkcd_red) |
|
961 |
|
|
967 |
962 |
|
|
968 |
|
self.pen_success.setZValue(-100) |
|
969 |
|
self.pen_outside.setZValue(-100) |
|
970 |
|
self.pen_mix.setZValue(-100) |
|
971 |
|
self.pen_f.setZValue(-100) |
|
972 |
963 |
|
|
973 |
964 |
self.pen_vertex = self.plot(x, y, pen='c', name="simple pf estimation") |
self.pen_vertex = self.plot(x, y, pen='c', name="simple pf estimation") |
974 |
965 |
self.pen_weighted_vertex = self.plot(x, y, pen=(170, 170, 255), name="weighted pf estimation") |
self.pen_weighted_vertex = self.plot(x, y, pen=(170, 170, 255), name="weighted pf estimation") |
|
... |
... |
class SimpleSimplexEstimationGraph(pg.PlotWidget): |
979 |
970 |
self.pen_exact = self.plot(x, y, pen='b', name=exact_name) # blue |
self.pen_exact = self.plot(x, y, pen='b', name=exact_name) # blue |
980 |
971 |
|
|
981 |
972 |
|
|
982 |
|
self.redraw() |
|
|
973 |
|
def replot(self, *args, **kwargs): |
|
974 |
|
if self.log_y_chk.isChecked(): |
|
975 |
|
self.setLogMode(y=True) |
|
976 |
|
self.pen_f.setPen(pg.mkPen(color=(255, 0, 0), width=3)) #, style=QtCore.Qt.DashLine) |
|
977 |
|
|
|
978 |
|
self.pen_success.setZValue(-40) |
|
979 |
|
self.pen_outside.setZValue(-60) |
|
980 |
|
self.pen_mix.setZValue(-80) |
|
981 |
|
self.pen_f.setZValue(-100) |
|
982 |
|
|
|
983 |
|
|
|
984 |
|
else: |
|
985 |
|
self.setLogMode(y=False) |
|
986 |
|
self.pen_f.setPen(None) |
|
987 |
|
|
|
988 |
|
self.pen_success.setZValue(-80) |
|
989 |
|
self.pen_outside.setZValue(-60) |
|
990 |
|
self.pen_mix.setZValue(-40) |
|
991 |
|
self.pen_f.setZValue(-20) |
983 |
992 |
|
|
|
993 |
|
self.redraw() |
|
994 |
|
|
984 |
995 |
|
|
985 |
996 |
def redraw(self): |
def redraw(self): |
986 |
997 |
xmin = np.inf |
xmin = np.inf |