A succinct matplotlib wrapper for making beautiful, publication-quality graphics.
—
Comprehensive axis scaling system including logarithmic, power, inverse, and custom scales with seamless integration into matplotlib's transformation pipeline. Proplot extends matplotlib's scale system with additional scales and enhanced functionality.
class LinearScale:
"""Linear axis scaling (default)."""
class LogScale:
"""Logarithmic axis scaling."""
class SymmetricalLogScale:
"""Symmetric logarithmic scaling for data crossing zero."""
class LogitScale:
"""Logit scaling for probability data."""
class PowerScale:
"""Power law scaling with configurable exponent."""
class InverseScale:
"""Inverse scaling (1/x transformation)."""
class ExpScale:
"""Exponential scaling."""
class CutoffScale:
"""Scale with arbitrary cutoff points for piecewise linear scaling."""
class FuncScale:
"""Scale with arbitrary forward and inverse functions."""
class SineLatitudeScale:
"""Sine latitude scaling for geographic data."""
class MercatorLatitudeScale:
"""Mercator latitude scaling for geographic projections."""def Scale(*args, **kwargs):
"""
Construct axis scale instances from various specifications.
Parameters:
- scale (str): Scale name ('linear', 'log', 'symlog', 'power', etc.)
- **kwargs: Scale-specific parameters
Scale Types:
- 'linear': Linear scaling
- 'log': Logarithmic scaling
- 'symlog': Symmetric logarithmic scaling
- 'logit': Logit scaling for probabilities
- 'power': Power law scaling
- 'inverse': Inverse (1/x) scaling
- 'exp': Exponential scaling
- 'cutoff': Piecewise linear with cutoffs
- 'func': Custom function scaling
- 'sine': Sine latitude scaling
- 'mercator': Mercator latitude scaling
Returns:
Scale: Appropriate scale instance
"""import proplot as pplt
import numpy as np
# Logarithmic scaling
fig, ax = pplt.subplots()
ax.plot(x, y)
ax.format(yscale='log')
# Power scaling
ax.format(xscale='power', xscale_kw={'power': 0.5})
# Custom function scaling
from proplot import FuncScale
scale = FuncScale(lambda x: x**2, lambda x: np.sqrt(x))
ax.format(yscale=scale)
# Cutoff scaling for multi-range data
ax.format(yscale='cutoff', yscale_kw={'cutoffs': [1, 10, 100]})Install with Tessl CLI
npx tessl i tessl/pypi-proplot