Class ScaleType
java.lang.Object
uk.ac.starlink.ttools.plot2.ScaleType
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classDefines a numerical parameter for a ScaleType. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ScaleTypeScale type using inverse hyperbolic sin scaling.static final ScaleTypeLinear scale type, no parameters.static final ScaleTypeLogarithmic scale type, no parameters.static final ScaleTypeScale type using so-called symmetric log scaling.static final ScaleTypeTime scale type, linear but with a custom rounding. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedScaleType(String scaleName, ScaleType.Param[] params) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionabstract ScalecreateScale(double[] paramValues) Constructs a scale.static ScaleTypeReturns a ScaleType instance with the given name.abstract StringReturns an XML description of this scale type.static ScaleType[]Returns a list of the general-purpose instances of this class.getName()Returns the name of this type.Returns the ordered list of parameter definitions that must be supplied for scales produced by this type.toString()
-
Field Details
-
LINEAR
Linear scale type, no parameters. -
LOG
Logarithmic scale type, no parameters. -
SYMLOG
Scale type using so-called symmetric log scaling. It can represent a wide dynamic range of values including negative ones. This idea is copied from Matplotlib's symlog scale. The region around the origin is linear, but outside that region values are scaled logarithmically, or negative logarithmically below zero.Scales have two parameters which must both be >0:
linthresh: defines the linear region (-linthresh..linthresh)linscale: ratio of graphical extent of the region (0,linthresh) to a decade in the logarithmic region
linthresh -
ASINH
Scale type using inverse hyperbolic sin scaling. The scaling function isx -> asinh(x/a). This function is asymptotically linear near the origin, and asymptotically logarithmic (or negative logarithmic) far from the origin. The "linear width" parametera, which must be >0, defines the extent of the quasi-linear region. -
TIME
Time scale type, linear but with a custom rounding.
-
-
Constructor Details
-
ScaleType
Constructor.- Parameters:
scaleName- short name for the scale typeparams- numeric parameters of this scale type
-
-
Method Details
-
createScale
Constructs a scale. The supplied parameter values must match those defined by the result of the {#getParams} method. Missing later values are permitted, and will be set to the default value of the relevant parameter.- Parameters:
paramValues- numeric arguments for this scale- Returns:
- new scale
- Throws:
IllegalArgumentException- if the values are not acceptable
-
getParams
Returns the ordered list of parameter definitions that must be supplied for scales produced by this type. This may be an empty array if the scale type is not parameterised.- Returns:
- scale parameter specifications
-
getName
-
getDescription
Returns an XML description of this scale type.- Returns:
- description in XML-friendly text, but not wrapped in any element
-
toString
-
getInstances
Returns a list of the general-purpose instances of this class.- Returns:
- instance list
-
fromName
-