def __setup_layout( self ): self.connect( self.button, QtCore.SIGNAL( 'clicked()' ), self.button_Click ) self.connect( self.button2, QtCore.SIGNAL( 'clicked()' ), self.button_Click2 ) self.connect( self.button3, QtCore.SIGNAL( 'clicked()' ), self.button_Click3 ) self.connect( self.button4, QtCore.SIGNAL( 'clicked()' ), self.button_Click4 ) self.connect( self.button5, QtCore.SIGNAL( 'clicked()' ), self.button_Click5 ) self.connect( self.button6, QtCore.SIGNAL( 'clicked()' ), self.button_Click6 ) # Vertical cursor self.cursorposition = 0.8 self.cursorposition2 = 1.2 self.vcursor1 = make.vcursor(self.cursorposition, label='x = %.2f') self.plot.add_item( self.vcursor1 ) self.vcursor2 = make.vcursor(self.cursorposition2, label='x = %.2f') self.plot.add_item( self.vcursor2 ) # Define the y label, x might change depending on user definition CurvePlot.set_axis_title(self.plot,CurvePlot.Y_LEFT,"Intensity (counts)") # Crate the PlotManager self.manager = PlotManager( self ) self.manager.add_plot( self.plot ) self.manager.add_plot( self.plot2 ) # Create Toolbar toolbar = self.addToolBar( 'tools' ) self.manager.add_toolbar( toolbar, id( toolbar ) ) # Register the ToolBar's type self.manager.register_all_curve_tools( ) # self.manager.register_other_tools() # Register a custom tool self.manager.add_tool( SelectPointTool, title = 'Position', on_active_item = True, mode = 'create' )
def test(): """Test""" # -- Create QApplication import guidata _app = guidata.qapplication() # -- from numpy import linspace, sin x = linspace(-10, 10, 1000)+1 y = sin(sin(sin(x)))+3 curve = make.curve(x, y, "ab", "b") hcursor = make.hcursor(3.2, label='y = %.2f') vcursor = make.vcursor(7, label='x = %.2f') vcursor2 = make.vcursor(-1, label='NOT MOVABLE = %.2f', movable=False) xcursor = make.xcursor(-4, 2.5, label='x = %.2f<br>y = %.2f') legend = make.legend("TR") plot(curve, hcursor, vcursor, vcursor2, xcursor, legend)
def test(): """Test""" # -- Create QApplication import guidata _app = guidata.qapplication() # -- from numpy import linspace, sin x = linspace(-10, 10, 1000) + 1 y = sin(sin(sin(x))) + 3 curve = make.curve(x, y, "ab", "b") hcursor = make.hcursor(3.2, label='y = %.2f') vcursor = make.vcursor(7, label='x = %.2f') vcursor2 = make.vcursor(-1, label='NOT MOVABLE = %.2f', movable=False) xcursor = make.xcursor(-4, 2.5, label='x = %.2f<br>y = %.2f') legend = make.legend("TR") plot(curve, hcursor, vcursor, vcursor2, xcursor, legend)
def addVCursor(self, i): self.vCursor = make.vcursor(i) self.plot.add_item(self.vCursor)