Changeset 5120


Ignore:
Timestamp:
Dec 29, 2021 2:05:57 PM (6 months ago)
Author:
toby
Message:

fix arrow keys for PlotPattern? in w mode

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIplot.py

    r5114 r5120  
    767767    def OnArrow(self,event):
    768768        'reposition limits to scan or zoom by button press'
    769         ax = self.plotCanvas.figure.get_axes()[0]
     769        axlist = self.plotCanvas.figure.get_axes()
     770        if len(axlist) == 1:
     771             ax = axlist[0]
     772             ax1 = None
     773        elif len(axlist) == 3: # used in "w" mode in PlotPatterns
     774             _,ax,ax1 = axlist
     775             xmin,xmax,ymin1,ymax1 = ax1.axis()
     776        else:
     777            return
    770778        xmin,xmax,ymin,ymax = ax.axis()
    771779        #print xmin,xmax,ymin,ymax
     
    808816        self.parent.toolbar.push_current()      #NB: self.parent.toolbar = self
    809817        ax.axis((xmin,xmax,ymin,ymax))
     818        if ax1:
     819            ax1.axis((xmin,xmax,ymin1,ymax1))
    810820        #print xmin,xmax,ymin,ymax
    811821        self.plotCanvas.figure.canvas.draw()
Note: See TracChangeset for help on using the changeset viewer.