Scale¶
-
Scale
(scale, *args, **kwargs)[source]¶ Return a
ScaleBase
instance. This function is used to interpret thexscale
,xscale_kw
,yscale
, andyscale_kw
arguments when passed toformat
.- Parameters
scale (
ScaleBase
, str, (str, …), or class) – IfScaleBase
, 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'
Linear
'log'
Logarithmic
'symlog'
Logarithmic beyond finite space around zero
'logit'
Logistic
'inverse'
Inverse
'function'
Scale from arbitrary forward and backwards functions
'sine'
Sine function (in degrees)
'mercator'
Mercator latitude function (in degrees)
'exp'
Arbitrary exponential function
'power'
Arbitrary power function
'cutoff'
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.