Scale

Scale(scale, *args, **kwargs)[source]

Return a ScaleBase instance. This function is used to interpret the xscale, xscale_kw, yscale, and yscale_kw arguments when passed to format.

Parameters
  • scale (ScaleBase, str, (str, …), or class) – If ScaleBase, the object is returned.

    If string, this is the registered scale name or scale “preset” (see below table).

    If list or tuple and the first element is a string, the subsequent items are passed to the scale class as positional arguments. For example, ax.format(xscale=('power', 2)) applies the 'quadratic' scale to the x axis.

    Key

    Class

    Description

    'linear'

    LinearScale

    Linear

    'log'

    LogScale

    Logarithmic

    'symlog'

    SymmetricalLogScale

    Logarithmic beyond finite space around zero

    'logit'

    LogitScale

    Logistic

    'inverse'

    InverseScale

    Inverse

    'function'

    FuncScale

    Scale from arbitrary forward and backwards functions

    'sine'

    SineLatitudeScale

    Sine function (in degrees)

    'mercator'

    MercatorLatitudeScale

    Mercator latitude function (in degrees)

    'exp'

    ExpScale

    Arbitrary exponential function

    'power'

    PowerScale

    Arbitrary power function

    'cutoff'

    CutoffScale

    Arbitrary piecewise linear transformations

    'quadratic'

    PowerScale (preset)

    Quadratic function

    'cubic'

    PowerScale (preset)

    Cubic function

    'quartic'

    PowerScale (preset)

    Cubic function

    'db'

    ExpScale (preset)

    Ratio expressed as decibels

    'np'

    ExpScale (preset)

    Ratio expressed as nepers

    'idb'

    ExpScale (preset)

    Decibels expressed as ratio

    'inp'

    ExpScale (preset)

    Nepers expressed as ratio

    'pressure'

    ExpScale (preset)

    Height (in km) expressed linear in pressure

    'height'

    ExpScale (preset)

    Pressure (in hPa) expressed linear in height

  • *args, **kwargs – Passed to the ScaleBase class.

Returns

ScaleBase – The scale instance.