Spamworldpro Mini Shell
Spamworldpro


Server : Apache
System : Linux indy02.toastserver.com 3.10.0-962.3.2.lve1.5.85.el7.x86_64 #1 SMP Thu Apr 18 15:18:36 UTC 2024 x86_64
User : palandch ( 1163)
PHP Version : 7.1.33
Disable Function : NONE
Directory :  /opt/alt/python27/lib64/python2.7/site-packages/matplotlib/testing/jpl_units/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //opt/alt/python27/lib64/python2.7/site-packages/matplotlib/testing/jpl_units/UnitDblFormatter.py
#===========================================================================
#
# UnitDblFormatter
#
#===========================================================================

"""UnitDblFormatter module containing class UnitDblFormatter."""

#===========================================================================
# Place all imports after here.
#
import matplotlib.ticker as ticker
#
# Place all imports before here.
#===========================================================================

__all__ = [ 'UnitDblFormatter' ]

#===========================================================================
class UnitDblFormatter( ticker.ScalarFormatter ):
   """The formatter for UnitDbl data types.  This allows for formatting
      with the unit string.
   """
   def __init__( self, *args, **kwargs ):
      'The arguments are identical to matplotlib.ticker.ScalarFormatter.'
      ticker.ScalarFormatter.__init__( self, *args, **kwargs )

   def __call__( self, x, pos = None ):
      'Return the format for tick val x at position pos'
      if len(self.locs) == 0:
         return ''
      else:
         return str(x)

   def format_data_short( self, value ):
      "Return the value formatted in 'short' format."
      return str(value)

   def format_data( self, value ):
      "Return the value formatted into a string."
      return str(value)

Spamworldpro Mini