lib/mpl_toolkits/mplot3d/axes3d.py
def _on_move(self, event):
        """Mouse moving

        button-1 rotates
        button-3 zooms
        """
        if not self.button_pressed:
            return

        if self.M is None:
            return

        x, y = event.xdata, event.ydata
        # In case the mouse is out of bounds.
        if x == None:
            return

        dx, dy = x - self.sx, y - self.sy
        x0, x1 = self.get_xlim()
        y0, y1 = self.get_ylim()
        w = (x1-x0)
        h = (y1-y0)
        self.sx, self.sy = x, y

        if self.button_pressed == 1:
            # rotate viewing point
            # get the x and y pixel coords
            if dx == 0 and dy == 0:
                return
            self.elev = art3d.norm_angle(self.elev - (dy/h)*180)
            self.azim = art3d.norm_angle(self.azim - (dx/w)*180)
            self.get_proj()
            self.figure.canvas.draw()
        elif self.button_pressed == 2:
            # pan view
            # project xv,yv,zv -> xw,yw,zw
            # pan
            pass
        elif self.button_pressed == 3:
            # zoom view
            # hmmm..this needs some help from clipping....
            minx, maxx, miny, maxy, minz, maxz = self.get_w_lims()
            df = 1-((h - dy)/h)
            dx = (maxx-minx)*df
            dy = (maxy-miny)*df
            dz = (maxz-minz)*df
            self.set_xlim3d(minx - dx, maxx + dx)
            self.set_ylim3d(miny - dy, maxy + dy)
            self.set_zlim3d(minz - dz, maxz + dz)
            self.get_proj()
            self.figure.canvas.draw()
Mouse moving

        button-1 rotates
        button-3 zooms
        
Mouse moving
button-1 rotates
button-3 zooms
Mouse moving button - 1 rotates button - 3 zooms
def _on_move(self, event):
        if not self.button_pressed:
            return
        if self.M is None:
            return
        x, y = event.xdata, event.ydata
        if x == None:
            return
        dx, dy = x - self.sx, y - self.sy
        x0, x1 = self.get_xlim()
        y0, y1 = self.get_ylim()
        w = (x1-x0)
        h = (y1-y0)
        self.sx, self.sy = x, y
        if self.button_pressed == 1:
            if dx == 0 and dy == 0:
                return
            self.elev = art3d.norm_angle(self.elev - (dy/h)*180)
            self.azim = art3d.norm_angle(self.azim - (dx/w)*180)
            self.get_proj()
            self.figure.canvas.draw()
        elif self.button_pressed == 2:
            pass
        elif self.button_pressed == 3:
            minx, maxx, miny, maxy, minz, maxz = self.get_w_lims()
            df = 1-((h - dy)/h)
            dx = (maxx-minx)*df
            dy = (maxy-miny)*df
            dz = (maxz-minz)*df
            self.set_xlim3d(minx - dx, maxx + dx)
            self.set_ylim3d(miny - dy, maxy + dy)
            self.set_zlim3d(minz - dz, maxz + dz)
            self.get_proj()
            self.figure.canvas.draw()
def _on_move ( self , event ) : if not self . button_pressed : return if self . M is None : return x , y = event . xdata , event . ydata if x == None : return dx , dy = x - self . sx , y - self . sy x0 , x1 = self . get_xlim ( ) y0 , y1 = self . get_ylim ( ) w = ( x1 - x0 ) h = ( y1 - y0 ) self . sx , self . sy = x , y if self . button_pressed == 1 : if dx == 0 and dy == 0 : return self . elev = art3d . norm_angle ( self . elev - ( dy / h ) * 180 ) self . azim = art3d . norm_angle ( self . azim - ( dx / w ) * 180 ) self . get_proj ( ) self . figure . canvas . draw ( ) elif self . button_pressed == 2 : pass elif self . button_pressed == 3 : minx , maxx , miny , maxy , minz , maxz = self . get_w_lims ( ) df = 1 - ( ( h - dy ) / h ) dx = ( maxx - minx ) * df dy = ( maxy - miny ) * df dz = ( maxz - minz ) * df self . set_xlim3d ( minx - dx , maxx + dx ) self . set_ylim3d ( miny - dy , maxy + dy ) self . set_zlim3d ( minz - dz , maxz + dz ) self . get_proj ( ) self . figure . canvas . draw ( )
Mouse moving
button-1 rotates
button-3 zooms
Mouse moving button - 1 rotates button - 3 zooms
"""Mouse moving

        button-1 rotates
        button-3 zooms
        """ # In case the mouse is out of bounds. # rotate viewing point # get the x and y pixel coords # pan view # project xv,yv,zv -> xw,yw,zw # pan # zoom view # hmmm..this needs some help from clipping....
self
event