def hist2d_func(X, Y, Z): win = ImageDialog(edit=True, toolbar=True, wintitle="2-D Histogram X0=(0,1), X1=(-1,-1)") hist2d = make.histogram2D(X, Y, 200, 200, Z=Z, computation=2) curve = make.curve(X[::50], Y[::50], linestyle="", marker="+", title=_("Markers")) plot = win.get_plot() plot.set_aspect_ratio(lock=False) plot.set_antialiasing(False) plot.add_item(hist2d) plot.add_item(curve) plot.set_item_visible(curve, False) win.show() win.exec_()
def hist2d_func(X, Y, Z): win = ImageDialog(edit=True, toolbar=True, wintitle="2-D Histogram X0=(0,1), X1=(-1,-1)") hist2d = make.histogram2D(X, Y, 200, 200, Z=Z, computation=2) curve = make.curve(X[::50], Y[::50], linestyle='', marker='+', title=_("Markers")) plot = win.get_plot() plot.set_aspect_ratio(lock=False) plot.set_antialiasing(False) plot.add_item(hist2d) plot.add_item(curve) plot.set_item_visible(curve, False) win.show() win.exec_()
def __init__(self, fit): Plot.__init__(self, fit) self.layout = QtWidgets.QVBoxLayout(self) self.source = fit.surface self.d1 = np.array([0.0]) self.d2 = np.array([0.0]) top_left = QtWidgets.QFrame(self) top_left.setMaximumHeight(150) top_left.setFrameShape(QtWidgets.QFrame.StyledPanel) topl = QtWidgets.QVBoxLayout(top_left) top_right = QtWidgets.QFrame(self) top_right.setMaximumHeight(150) top_right.setFrameShape(QtWidgets.QFrame.StyledPanel) topr = QtWidgets.QVBoxLayout(top_right) bottom = QtWidgets.QFrame(self) bottom.setFrameShape(QtWidgets.QFrame.StyledPanel) bot = QtWidgets.QVBoxLayout(bottom) splitter1 = QtWidgets.QSplitter(QtCore.Qt.Horizontal) splitter1.addWidget(top_left) splitter1.addWidget(top_right) splitter2 = QtWidgets.QSplitter(QtCore.Qt.Vertical) splitter2.addWidget(splitter1) splitter2.addWidget(bottom) self.splitter = splitter2 self.layout.addWidget(splitter2) # x-axis win = CurveDialog() self.g_xplot = win.get_plot() self.g_xhist_m = make.histogram([], color='#ff00ff') self.g_xhist_a = make.histogram([], color='#6f0000') self.g_xplot.add_item(self.g_xhist_a) self.g_xplot.add_item(self.g_xhist_m) topl.addWidget(self.g_xplot) # y-axis win = CurveDialog() self.g_yplot = win.get_plot() self.g_yhist_m = make.histogram([], color='#00ff00') self.g_yhist_a = make.histogram([], color='#006600') self.g_yplot.add_item(self.g_yhist_a) self.g_yplot.add_item(self.g_yhist_m) topr.addWidget(self.g_yplot) # 2D-Histogram self.g_hist2d_m = make.histogram2D(np.array([0.0, 0.0]), np.array([0.0, 0.0]), logscale=True) self.g_hist2d_a = make.histogram2D(np.array([0.0, 0.0]), np.array([0.0, 0.0]), logscale=True) self.g_hist2d_m.set_color_map('hot') self.g_hist2d_a.set_color_map('Blues') #self.g_hist2d_m.set_interpolation(INTERP_LINEAR) #self.g_hist2d_a.set_interpolation(INTERP_LINEAR) win = ImageDialog(edit=False, toolbar=False) self.g_xyplot = win.get_plot() self.g_xyplot.set_aspect_ratio(lock=False) self.g_xyplot.add_item(self.g_hist2d_a) self.g_xyplot.add_item(self.g_hist2d_m) bot.addWidget(win) #selection self.selection_x = make.range(.25, .5) self.g_xplot.add_item(self.selection_x) self.selection_y = make.range(.25, .5) self.g_yplot.add_item(self.selection_y) self.pltControl = SurfacePlotWidget(self) self.widgets = [self.pltControl]