lib/mpl_toolkits/mplot3d/axes3d.py
def format_coord(self, xd, yd):
        """
        Given the 2D view coordinates attempt to guess a 3D coordinate.
        Looks for the nearest edge to the point and then assumes that
        the point is at the same z location as the nearest point on the edge.
        """

        if self.M is None:
            return ''

        if self.button_pressed == 1:
            return 'azimuth=%d deg, elevation=%d deg ' % (self.azim, self.elev)
            # ignore xd and yd and display angles instead

        p = (xd, yd)
        edges = self.tunit_edges()
        #lines = [proj3d.line2d(p0,p1) for (p0,p1) in edges]
        ldists = [(proj3d.line2d_seg_dist(p0, p1, p), i) for \
                i, (p0, p1) in enumerate(edges)]
        ldists.sort()
        # nearest edge
        edgei = ldists[0][1]

        p0, p1 = edges[edgei]

        # scale the z value to match
        x0, y0, z0 = p0
        x1, y1, z1 = p1
        d0 = np.hypot(x0-xd, y0-yd)
        d1 = np.hypot(x1-xd, y1-yd)
        dt = d0+d1
        z = d1/dt * z0 + d0/dt * z1

        x, y, z = proj3d.inv_transform(xd, yd, z, self.M)

        xs = self.format_xdata(x)
        ys = self.format_ydata(y)
        zs = self.format_ydata(z)
        return 'x=%s, y=%s, z=%s' % (xs, ys, zs)

        Given the 2D view coordinates attempt to guess a 3D coordinate.
        Looks for the nearest edge to the point and then assumes that
        the point is at the same z location as the nearest point on the edge.
        
Given the 2D view coordinates attempt to guess a 3D coordinate.
Looks for the nearest edge to the point and then assumes that
the point is at the same z location as the nearest point on the edge.
Given the 2D view coordinates attempt to guess a 3D coordinate . Looks for the nearest edge to the point and then assumes that the point is at the same z location as the nearest point on the edge .
def format_coord(self, xd, yd):
        if self.M is None:
            return ''
        if self.button_pressed == 1:
            return 'azimuth=%d deg, elevation=%d deg ' % (self.azim, self.elev)
        p = (xd, yd)
        edges = self.tunit_edges()
        ldists = [(proj3d.line2d_seg_dist(p0, p1, p), i) for \
                i, (p0, p1) in enumerate(edges)]
        ldists.sort()
        edgei = ldists[0][1]
        p0, p1 = edges[edgei]
        x0, y0, z0 = p0
        x1, y1, z1 = p1
        d0 = np.hypot(x0-xd, y0-yd)
        d1 = np.hypot(x1-xd, y1-yd)
        dt = d0+d1
        z = d1/dt * z0 + d0/dt * z1
        x, y, z = proj3d.inv_transform(xd, yd, z, self.M)
        xs = self.format_xdata(x)
        ys = self.format_ydata(y)
        zs = self.format_ydata(z)
        return 'x=%s, y=%s, z=%s' % (xs, ys, zs)
def format_coord ( self , xd , yd ) : if self . M is None : return '' if self . button_pressed == 1 : return 'azimuth=%d deg, elevation=%d deg ' % ( self . azim , self . elev ) p = ( xd , yd ) edges = self . tunit_edges ( ) ldists = [ ( proj3d . line2d_seg_dist ( p0 , p1 , p ) , i ) for i , ( p0 , p1 ) in enumerate ( edges ) ] ldists . sort ( ) edgei = ldists [ 0 ] [ 1 ] p0 , p1 = edges [ edgei ] x0 , y0 , z0 = p0 x1 , y1 , z1 = p1 d0 = np . hypot ( x0 - xd , y0 - yd ) d1 = np . hypot ( x1 - xd , y1 - yd ) dt = d0 + d1 z = d1 / dt * z0 + d0 / dt * z1 x , y , z = proj3d . inv_transform ( xd , yd , z , self . M ) xs = self . format_xdata ( x ) ys = self . format_ydata ( y ) zs = self . format_ydata ( z ) return 'x=%s, y=%s, z=%s' % ( xs , ys , zs )
Given the 2D view coordinates attempt to guess a 3D coordinate.
Given the 2D view coordinates attempt to guess a 3D coordinate .
"""
        Given the 2D view coordinates attempt to guess a 3D coordinate.
        Looks for the nearest edge to the point and then assumes that
        the point is at the same z location as the nearest point on the edge.
        """ # ignore xd and yd and display angles instead #lines = [proj3d.line2d(p0,p1) for (p0,p1) in edges] # nearest edge # scale the z value to match
self
xd
yd