(self, x, axis)
Handles display-range-specific formatting for the x and y coords.

        Parameters
        ----------
        x : number
            The number to be formatted
        axis : matplotlib.axis.Axis
            The Axis instance that we're working with (e.g. ax.xaxis, etc)
Handles display-range-specific formatting for the x and y coords.
Handles display - range - specific formatting for the x and y coords .
def _format_coord(self, x, axis):
        """
        Handles display-range-specific formatting for the x and y coords.

        Parameters
        ----------
        x : number
            The number to be formatted
        axis : matplotlib.axis.Axis
            The Axis instance that we're working with (e.g. ax.xaxis, etc)
        """
        if x is None:
            return None

        limits = axis.get_view_interval()
        formatter = self._mplformatter
        # Trick the formatter into thinking we have an axes
        # The 7 tick locations is arbitrary but gives a reasonable detail level
        formatter.locs = np.linspace(limits[0], limits[1], 7)

        try:
            # Older versions of mpl
            formatter._set_orderOfMagnitude(abs(np.diff(limits)))
            formatter._set_format(*limits)
        except (AttributeError, TypeError):
            # 3.1.1 or later
            formatter.axis = axis
            formatter._set_format()
            formatter._set_order_of_magnitude()
        
        try:
            # Again, older versions of mpl
            return formatter.pprint_val(x)
        except AttributeError:
            # 3.3.0 or later
            return formatter.format_data_short(x)
def _format_coord ( self , x , axis ) : if x is None : return None limits = axis . get_view_interval ( ) formatter = self . _mplformatter # Trick the formatter into thinking we have an axes # The 7 tick locations is arbitrary but gives a reasonable detail level formatter . locs = np . linspace ( limits [ 0 ] , limits [ 1 ] , 7 ) try : # Older versions of mpl formatter . _set_orderOfMagnitude ( abs ( np . diff ( limits ) ) ) formatter . _set_format ( * limits ) except ( AttributeError , TypeError ) : # 3.1.1 or later formatter . axis = axis formatter . _set_format ( ) formatter . _set_order_of_magnitude ( ) try : # Again, older versions of mpl return formatter . pprint_val ( x ) except AttributeError : # 3.3.0 or later return formatter . format_data_short ( x )