A succinct matplotlib wrapper for making beautiful, publication-quality graphics.
—
Advanced tick locator and formatter system with support for scientific notation, fractions, geographic coordinates, and custom number formatting patterns. Proplot provides enhanced tick control with specialized formatters and locators for scientific and geographic applications.
class AutoFormatter:
"""Automatic number formatting with flexible precision."""
class SciFormatter:
"""Format numbers with scientific notation."""
class SigFigFormatter:
"""Format numbers to specified significant figures."""
class SimpleFormatter:
"""Format numbers with flexible precision and features."""
class FracFormatter:
"""Format numbers as fractions or multiples."""
class DegreeFormatter:
"""Format numbers as geographic coordinates."""
class LongitudeFormatter:
"""Format longitude coordinates with E/W designations."""
class LatitudeFormatter:
"""Format latitude coordinates with N/S designations."""class DegreeLocator:
"""Locate degree coordinates with customizable spacing."""
class LongitudeLocator:
"""Locate longitude coordinates."""
class LatitudeLocator:
"""Locate latitude coordinates."""def Locator(*args, **kwargs):
"""
Construct tick locator instances.
Parameters:
- locator (str/Locator): Locator specification
- **kwargs: Locator-specific parameters
Returns:
Locator: Matplotlib locator instance
"""
def Formatter(*args, **kwargs):
"""
Construct tick formatter instances.
Parameters:
- formatter (str/Formatter): Formatter specification
- **kwargs: Formatter-specific parameters
Returns:
Formatter: Matplotlib formatter instance
"""import proplot as pplt
# Scientific notation
fig, ax = pplt.subplots()
ax.format(yformatter='sci', yformatter_kw={'precision': 2})
# Geographic coordinates
fig, ax = pplt.subplots(proj='platecarree')
ax.format(
lonformatter='deglon', # Longitude with E/W
latformatter='deglat', # Latitude with N/S
lonlocator=pplt.Locator('deglon', dms=False),
latlocator=pplt.Locator('deglat', dms=False)
)
# Fraction formatting
ax.format(xformatter='frac', xformatter_kw={'symbol': 'π'})Install with Tessl CLI
npx tessl i tessl/pypi-proplot