CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/pypi-proplot

A succinct matplotlib wrapper for making beautiful, publication-quality graphics.

Pending
Overview
Eval results
Files

tick-control.mddocs/

Tick Control and Formatting

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.

Capabilities

Formatter Classes

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."""

Locator Classes

class DegreeLocator:
    """Locate degree coordinates with customizable spacing."""

class LongitudeLocator:
    """Locate longitude coordinates."""

class LatitudeLocator:
    """Locate latitude coordinates."""

Constructor Functions

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
    """

Usage Examples

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

docs

axes-plotting.md

colors-colormaps.md

configuration.md

demonstrations.md

figure-subplots.md

index.md

projections.md

scales.md

tick-control.md

utilities.md

tile.json