Changeset 4972de2 in sasview for guitools/PlotPanel.py


Ignore:
Timestamp:
Jun 18, 2008 6:08:43 PM (16 years ago)
Author:
Mathieu Doucet <doucetm@…>
Branches:
master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
aa4b8379
Parents:
fc2b91a
Message:

Updated for interactive graphs.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • guitools/PlotPanel.py

    rad8bcd6 r4972de2  
    1414from plottables import Theory1D 
    1515#TODO: make the plottables interactive 
     16from binder import BindArtist 
    1617 
    1718DEBUG = False 
    18 print "hello" 
    1919 
    2020from plottables import Graph 
     
    149149         
    150150        self.axes = [self.subplot] 
     151         
     152        # Interactor 
     153        self.connect = BindArtist(self.subplot.figure) 
     154        #self.selected_plottable = None 
     155 
    151156        # new data for the fit  
    152157        self.fit_result = Theory1D(x=[], y=[], dy=None) 
     
    560565    #    if trigger == 'xlim': self._connect_to_xlim(callback) 
    561566 
     567    def interactive_points(self,x,y,dx=None,dy=None,name='', color=0,symbol=0,label=None): 
     568        """Draw markers with error bars""" 
     569        self.subplot.set_yscale('linear') 
     570        self.subplot.set_xscale('linear') 
     571         
     572        from plottable_interactor import PointInteractor 
     573        p = PointInteractor(self, self.subplot, zorder=3, id=name) 
     574        p.points(x, y, dx, dy, color, symbol, label) 
     575         
     576        self.subplot.set_yscale(self.yscale) 
     577        self.subplot.set_xscale(self.xscale) 
     578 
     579    def interactive_curve(self,x,y,dy=None,name='',color=0,symbol=0,label=None): 
     580        """Draw markers with error bars""" 
     581        self.subplot.set_yscale('linear') 
     582        self.subplot.set_xscale('linear') 
     583         
     584        from plottable_interactor import PointInteractor 
     585        p = PointInteractor(self, self.subplot, zorder=4, id=name) 
     586        p.curve(x, y, dy, color, symbol, label) 
     587         
     588        self.subplot.set_yscale(self.yscale) 
     589        self.subplot.set_xscale(self.xscale) 
     590 
     591    def plottable_selected(self, id): 
     592        """ 
     593            Called to register a plottable as selected 
     594        """ 
     595        #TODO: check that it really is in the list of plottables 
     596        self.graph.selected_plottable = id 
     597 
    562598    def points(self,x,y,dx=None,dy=None,color=0,symbol=0,label=None): 
    563599        """Draw markers with error bars""" 
Note: See TracChangeset for help on using the changeset viewer.