Ignore:
Timestamp:
Aug 30, 2011 7:15:37 PM (13 years ago)
Author:
Jae Cho <jhjcho@…>
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:
fe48fcc
Parents:
5eede4e
Message:

keep the xylimit on update plot

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sansguiframe/src/sans/guiframe/local_perspectives/plotting/Plotter2D.py

    rfe857e2 re4a703a  
    166166        :param event: data event 
    167167        """ 
     168        xlo = None 
     169        xhi = None 
     170        ylo = None  
     171        yhi = None 
    168172        ## Update self.data2d with the current plot 
    169173        self.data2D = data 
    170174        if data.id in self.plots.keys(): 
    171175            #replace 
     176            xlo, xhi = self.subplot.get_xlim() 
     177            ylo, yhi = self.subplot.get_ylim() 
    172178            self.graph.replace(data) 
    173179            self.plots[data.id] = data 
     
    199205        self.default_zmin_ctl = self.zmin_2D 
    200206        self.default_zmax_ctl = self.zmax_2D 
     207        # Recover the x,y limits 
     208        if (xlo and xhi and ylo and yhi) != None: 
     209            if (xlo > data.xmin and xhi < data.xmax and\ 
     210                        ylo > data.ymin and yhi < data.ymax): 
     211                self.subplot.set_xlim((xlo, xhi))      
     212                self.subplot.set_ylim((ylo, yhi))   
    201213 
    202214    def onContextMenu(self, event): 
Note: See TracChangeset for help on using the changeset viewer.