Example #1
0
 def __init__(self, canvas, parent):
     self.toolitems = (
         ('Home', 'Reset original view', 'home', 'home'),
         ('Pan', 'Pan with left mouse, zoom with right', 'move', 'pan'),
         ('Zoom', 'Zoom to rectangle', 'zoom_to_rect', 'zoom'),
         ('Save', 'Save the figure', 'filesave', 'save_figure'),)
     NavigationToolbar2TkAgg.__init__(self, canvas, parent)
Example #2
0
 def __init__(self, canvas_, parent_):
     self.toolitems = (
         ('Zoom', 'зум', 'zoom_to_rect', 'zoom'),
         ('Subplots', 'Поправить поля', 'subplots', 'configure_subplots'),
         ('Save', 'Сохранить график', 'filesave', 'save_figure'),
     )
     NavigationToolbar2TkAgg.__init__(self, canvas_, parent_)
Example #3
0
	def __init__ (self, canvas, window):

		logx_icon = os.path.join (os.getcwd(), 'lib', 'log_x')
		logy_icon = os.path.join (os.getcwd(), 'lib', 'log_y')
		grid_icon = os.path.join (os.getcwd(), 'lib', 'grid_xy')

		self.toolitems = (
			('Home', 'Reset original view', 'home', 'home'),
			('Back', 'Previous view', 'back', 'back'),
			('Forward', 'Next view', 'forward', 'forward'),
			(None, None, None, None),
			('Pan', 'Pan', 'move', 'pan'),
			('Zoom', 'Zoom', 'zoom_to_rect', 'zoom'),
			(None, None, None, None),
			('Subplots', 'Configure', 'subplots', 'configure_subplots'),
			('Save', 'Save figure', 'filesave', 'save_figure'),
			('Log X', 'Toggle log X', logx_icon, 'logx_cb'),
			('Log Y', 'Toggle log Y', logy_icon, 'logy_cb'),
			('Grid XY', 'Toggle grid', grid_icon, 'grid_cb'),
		)

		NavigationToolbar2TkAgg.__init__ (self, canvas, window)

		self._homeCB = self.defaultHomeCB
		self._panCB  = self.defaultPanCB
		self._zoomCB = self.defaultZoomCB
		self._logx_cb = None
		self._logy_cb = None
		self._grid_cb = None
Example #4
0
 def __init__(self, canvas, parent):
     self.toolitems = (
         ('CSV', 'Save CSV', 'filesave', 'save_csv'),
         ('FIG', 'Save figure', 'filesave', 'save_figure'),
     )
     NavigationToolbar2TkAgg.__init__(self, canvas, parent)
     self._init_toolbar()
     self.configure(background='black')
 def __init__(self, canvas,root,parent):
     self.canvas = canvas
     self.root   = root
     self.parent = parent
     NavigationToolbar2TkAgg.__init__(self, canvas,root)
     self.lasso_button = self._custom_button(text="lasso",command=lambda: self.lasso(
             lambda inds: self.parent.multi_select_callback(inds),"lasso"),**DEFAULT_STYLE_1)
     self.pick_button = self._custom_button(text="select",command=lambda: self.picker(
             lambda ind: self.parent.single_select_callback(ind),"select"),**DEFAULT_STYLE_1)
Example #6
0
 def __init__(self, canvas_, parent_):
     self.toolitems = (
         ('Home', 'Reset original view', 'home', 'home'),
         ('Back', 'Go back', 'back', 'back'),
         ('Forward', 'Move forward', 'forward', 'forward'),
         ('Pan', 'Move around', 'move', 'pan'),
         ('Zoom', 'Zoom', 'zoom_to_rect', 'zoom'),
         (None, None, None, None),
         ('Subplots', 'Configure', 'subplots', 'configure_subplots'),
         ('Save', 'Save instance', 'filesave', 'save_figure'),
     )
     NavigationToolbar2TkAgg.__init__(self, canvas_, parent_)
Example #7
0
 def __init__(self,canvas_,parent_):
     self.toolitems = (
         ('Home', 'home', 'home', 'home'),
         ('Back', 'back', 'back', 'back'),
         ('Forward', 'forward', 'forward', 'forward'),
         (None, None, None, None),
         ('Pan', 'pan', 'move', 'pan'),
         ('Zoom', 'zoom', 'zoom_to_rect', 'zoom'),
         (None, None, None, None),
         ('Save', 'save', 'filesave', 'save_figure'),
         )
     NavigationToolbar2TkAgg.__init__(self,canvas_,parent_)
    def __init__(self, canvas,root,parent):
        self.canvas = canvas
        self.root   = root
        self.parent = parent
        font = tkFont.Font(weight="bold",underline=True)
        NavigationToolbar2TkAgg.__init__(self, canvas,root)

        style = {"bg":"darkblue","fg":"gray90"}
        self.lasso_button = self._custom_button(text="lasso",command=lambda: self.lasso(
                lambda inds: self.parent.multi_select_callback(inds),"lasso"),**style)
        self.pick_button = self._custom_button(text="select",command=lambda: self.picker(
                lambda ind: self.parent.single_select_callback(ind),"select"),**style )
Example #9
0
 def __init__(self,canvas_,parent_):
     self.toolitems = (
         ('Home', 'Return to original view', 'home', 'home'),
         #('Back', 'consectetuer adipiscing elit', 'back', 'back'),
         #('Forward', 'sed diam nonummy nibh euismod', 'forward', 'forward'),
         (None, None, None, None),
         ('Pan', 'Pan the plot', 'move', 'pan'),
         ('Zoom', 'Zoom in', 'zoom_to_rect', 'zoom'),
         (None, None, None, None),
         #('Subplots', 'putamus parum claram', 'subplots', 'configure_subplots'),
         ('Save', 'Save figure', 'filesave', 'save_figure'),
         )
     NavigationToolbar2TkAgg.__init__(self,canvas_,parent_)
 def __init__(self, canvas_, parent_):
     self.toolitems = (
         ('Home', 'Lorem ipsum dolor sit amet', 'home', 'home'),
         ('Back', 'consectetuer adipiscing elit', 'back', 'back'),
         ('Forward', 'sed diam nonummy nibh euismod', 'forward', 'forward'),
         (None, None, None, None),
         ('Pan', 'tincidunt ut laoreet', 'move', 'pan'),
         ('Zoom', 'dolore magna aliquam', 'zoom_to_rect', 'zoom'),
         (None, None, None, None),
         ('Subplots', 'putamus parum claram', 'subplots', 'configure_subplots'),
         ('Save', 'sollemnes in futurum', 'filesave', 'save_figure'),
     )
     NavigationToolbar2TkAgg.__init__(self, canvas_, parent_)
 def __init__(self, canvas, root, parent):
     self.canvas = canvas
     self.root = root
     self.parent = parent
     NavigationToolbar2TkAgg.__init__(self, canvas, root)
     self.lasso_button = self._custom_button(
         text="lasso",
         command=lambda: self.lasso(
             lambda inds: self.parent.multi_select_callback(inds), "lasso"))
     self.pick_button = self._custom_button(
         text="select",
         command=lambda: self.picker(
             lambda ind: self.parent.single_select_callback(ind), "select"))
    def __init__(self, canvas, window, parent_frame, execution_task_count,
                 image_text):

        #Se almacenan los datos correspondientes al Frame Padre (para saber dónde colocar
        #la ventana de salvado de gráfica), el texto con el que se guardan  por defecto las
        #gráficas resultantes y el número de Task en ejecución para que se diferencie de
        #los demás, respectivamente.
        self.__parent = parent_frame
        self.__image_text = image_text
        self.__execution_task_count = execution_task_count

        #Se inicializa la clase Padre para poder tener acceso a los métodos de éste.
        NavigationToolbar2TkAgg.__init__(self, canvas, window)
Example #13
0
 def __init__(self, canvas_, parent_):
     # TODO: make normal buttons later
     self.toolitems = (
         ('Home', '', 'home', 'home'),
         # ('Back', '', 'back', 'back'),
         # ('Forward', '', 'forward', 'forward'),
         # (None, None, None, None),
         # ('Pan', '', 'move', 'pan'),
         # ('Zoom', '', 'zoom_to_rect', 'zoom'),
         # (None, None, None, None),
         # ('Subplots', '', 'subplots', 'configure_subplots'),
         ('Save', '', 'filesave', 'save_figure'),
     )
     NavigationToolbar2TkAgg.__init__(self, canvas_, parent_)
Example #14
0
 def __init__(self, canvas_, parent_):
     # TODO: make normal buttons later
     self.toolitems = (
         ('Home', '', 'home', 'home'),
         # ('Back', '', 'back', 'back'),
         # ('Forward', '', 'forward', 'forward'),
         # (None, None, None, None),
         # ('Pan', '', 'move', 'pan'),
         # ('Zoom', '', 'zoom_to_rect', 'zoom'),
         # (None, None, None, None),
         # ('Subplots', '', 'subplots', 'configure_subplots'),
         ('Save', '', 'filesave', 'save_figure'),
     )
     NavigationToolbar2TkAgg.__init__(self, canvas_, parent_)
Example #15
0
 def __init__(self,canvas_,parent_, commHome):
     self.commHome = commHome
     self.toolitems = (
         ('Home', "Reset original view\n\ ('h' or 'r')", 'home', 'home'),
         ('Back', "previous view\n\ ('c' or 'left arrow' or 'backspace')", 'back', 'back'),
         ('Forward', "next view\n\ ('v' or 'left arrow')", 'forward', 'forward'),
         (None, None, None, None),
         ('Pan', "Pan axis (left mouse), Zoom (right mouse).\n\ ('p')", 'move', 'pan'),
         ('Zoom', "Zoom box\n\ ('o')", 'zoom_to_rect', 'zoom'),
         (None, None, None, None),
         ('Subplots', 'Configure subplots axis', 'subplots', 'configure_subplots'),
         ('Save', 'Save plot', 'filesave', 'save_figure'),
         )
     NavigationToolbar2TkAgg.__init__(self,canvas_,parent_)
Example #16
0
	def __init__(self,canvas_,parent_):

		directory = os.path.dirname(os.path.abspath(__file__))

		self.toolitems = (
			(None, None, None, None),
			('Home', 'Resetar para a visão original', 'home' , 'home'),
			('Back', 'Voltar para a visão anterior', directory + '/icons/icon_back_arrow', 'back'),
			('Forward', 'Ir para a próxima visão', directory + '/icons/icon_go_arrow', 'forward'),
			(None, None, None, None),
			('Pan', 'Eixos panorâmicos com botão esquerdo do mouse, zoom com o direito', directory + '/icons/move', 'pan'),
			('Zoom', 'Zoom Retangular', 'zoom_to_rect', 'zoom'),
			(None, None, None, None),)

		NavigationToolbar2TkAgg.__init__(self,canvas_,parent_)
Example #17
0
 def __init__(self, canvas, parent):
     self.toolitems = (
         ('Unzoom', 'Reset original view', 'home', 'home'),
         ('Zoom', 'Zoom to rectangle', 'zoom_to_rect', 'zoom'),
         ('Pan', 'Pan axes with left mouse, zoom with right', 'move', 'pan'),
         (None, None, None, None),
         ('Save', 'Save', 'filesave', 'save_movie'),
         (None, None, None, None),
         ('Prev', 'Previous observation', 'back', 'backimg'),
         ('Next', 'Next observation', 'forward', 'fwdimg'),
         (None, None, None, None),
     )
     NavigationToolbar2TkAgg.__init__(self, canvas, parent)
     self._init_toolbar()
     self.configure(background='black')
Example #18
0
 def __init__(self, canvas_, parent_, edit_frame, app):
     self.parent_frame = parent_
     self.edit_frame = edit_frame
     self.toolitems = (
         ('Home', "Reset zoom", 'home', 'home'),
         ('Back', 'Undo one zoom step', 'back', 'back'),
         ('Forward', 'Redo one zoom step', 'forward', 'forward'),
         (None, None, None, None),
         (None, None, None, None),
         (None, None, None, None),
         ('Pan', 'Activate pan', 'move', 'pan'),
         ('Zoom', 'Activate zoom', 'zoom_to_rect', 'zoom'),
         # ("Lasso", "Activate lasso", "hand", "lasso")
     )
     self.app = app
     NavigationToolbar2TkAgg.__init__(self, canvas_, parent_)
Example #19
0
    def __init__(self, canvas, root, parent):
        self.canvas = canvas
        self.root = root
        self.parent = parent
        font = tkFont.Font(weight="bold", underline=True)
        NavigationToolbar2TkAgg.__init__(self, canvas, root)

        style = {"bg": "darkblue", "fg": "gray90"}
        self.lasso_button = self._custom_button(
            text="lasso",
            command=lambda: self.lasso(
                lambda inds: self.parent.multi_select_callback(inds), "lasso"),
            **style)
        self.pick_button = self._custom_button(
            text="select",
            command=lambda: self.picker(
                lambda ind: self.parent.single_select_callback(ind), "select"),
            **style)
 def __init__(self, canvas_, parent_):
     self.toolitems = (
         ("New", "New File", "new_file", "new_file"),
         ("Save", "Save File", "save_file", "save_figure"),
         ("Print", "Print", "printer", "print_figure"),
         (None, None, None, None),
         ("Home", "Home", "home", "home"),
         ("Refresh", "Refresh", "refresh", "refresh"),
         ("Backward", "Backward", "back3", "back"),
         ("Play", "Play", "play4", "play"),
         ("Forward", "Forward", "forward2", "forward"),
         ("Plot", "Plot", "plot", "plot"),
         (None, None, None, None),
         ("Move", "Move", "move", "pan"),
         ("Rotate", "Rotate", "rotate", "rotate"),
         ("Zoom in", "Zoom in", "zoom_in", "zoom_in"),
         ("Zoom out", "Zoom out", "zoom_out", "zoom_out"),
         (None, None, None, None),
         ("Subplots", "Subplots", "subplots2", "configure_subplots"),
     )
     NavigationToolbar2TkAgg.__init__(self, canvas_, parent_)
Example #21
0
    def __init__(self, canvas, root, parent):
        self.canvas = canvas
        self.root = root
        self.parent = parent  # plotter is parent
        self.ax = self.parent.ax  # axes needed for interaction
        self.xys = None  # for xy vals later associated with plot
        self.selected = None  # Holding area for selected indices

        # Generic mpl toolbar using tkagg (with standard buttons)
        NavigationToolbar2TkAgg.__init__(self, canvas, root)
        # Create lasso and link to multi_select_callback
        self.lasso_button = tk.Button(master=self,
                                      text='Lasso',
                                      padx=2,
                                      pady=2,
                                      command=self.startlasso)
        self.lasso_button.pack(side=tk.LEFT, fill="y")
        self.picker_button = tk.Button(master=self,
                                       text='Point',
                                       padx=2,
                                       pady=2,
                                       command=self.startpicker)
        self.picker_button.pack(side=tk.LEFT, fill="y")
        self.rect_button = tk.Button(master=self,
                                     text='Rectangle',
                                     padx=2,
                                     pady=2,
                                     command=self.startrect)
        self.rect_button.pack(side=tk.LEFT, fill="y")
        # TODO add circular selector w/ resizeable diameter
        self.spectrum_button = tk.Button(master=self,
                                         text='Extract spectrum',
                                         padx=2,
                                         pady=2,
                                         command=self.extract_spectrum)
        self.spectrum_button.pack(side=tk.LEFT, fill="y")
        print('toolbar loaded')
Example #22
0
    def __init__(self, canvas, root, parent):
        self.canvas = canvas
        self.root = root
        self.parent = parent  # plotter is parent
        self.ax = self.parent.ax  # axes needed for interaction
        self.xys = None  # for xy vals later associated with plot
        self.select = None  # lasso selected points for removal

        # Generic mpl toolbar using tkagg (with standard buttons)
        NavigationToolbar2TkAgg.__init__(self, canvas, root)
        # Create lasso and link to multi_select_callback
        self.lasso_button = tk.Button(master=self,
                                      text='lasso',
                                      padx=2,
                                      pady=2,
                                      command=self.startlasso)
        self.lasso_button.pack(side=tk.LEFT, fill="y")
        self.remove_pts_button = tk.Button(master=self,
                                           text='Remove pts',
                                           padx=2,
                                           pady=2,
                                           command=self.removepts)
        self.remove_pts_button.pack(side=tk.LEFT, fill="y")
        self.picker_button = tk.Button(master=self,
                                       text='add point',
                                       padx=2,
                                       pady=2,
                                       command=self.startpicker)
        self.picker_button.pack(side=tk.LEFT, fill="y")
        self.show_button = tk.Button(master=self,
                                     text='Show backfit segments',
                                     padx=2,
                                     pady=2,
                                     command=self.showbackseg)
        self.show_button.pack(side=tk.LEFT, fill="y")
        print('toolbar loaded')
Example #23
0
 def __init__(self,canvas_,parent,ax):
     NavigationToolbar2TkAgg.__init__(self,canvas_,parent)
     self._xlim = (0,1)
     self._ylim = (0,1)
     self._ax = ax
     self._canvas_ = canvas_
Example #24
0
	def __init__(self,c,w,l,call):
		self.dispOpt=l
		self.myCallback=call
		NavigationToolbar2TkAgg.__init__(self,c,w)
Example #25
0
 def __init__(self, parent, canvas):
   self.parent = parent
   NavigationToolbar2TkAgg.__init__(self, canvas, window=parent)
 def __init__(self, canvas, window):
     self.toolitems = [tool for tool in NavigationToolbar2TkAgg.toolitems if tool[0] in ('Pan', 'Save')]
     self.toolitems.reverse()
     NavigationToolbar2TkAgg.__init__(self, canvas, window)
 def __init__(self, plotCanvas, master_frame):
     NavigationToolbar2TkAgg.__init__(self, plotCanvas, master_frame)
Example #28
0
 def __init__(self):
     NavigationToolbar2TkAgg.__init__(self, canvas, window)