Class BinSizer
java.lang.Object
uk.ac.starlink.ttools.plot2.layer.BinSizer
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classSpecifier for BinSizer values. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic BinSizercreateCountBinSizer(double nbin) Returns a bin sizer instance which divides the axis range up into an approximately fixed number of equal intervals.static BinSizercreateFixedBinSizer(double scaleWidth) Returns a bin sizer instance which always returns the same fixed value.createSizerConfigKey(ConfigMeta meta, ReportKey<Double> widthReportKey, int dfltNbin, boolean allowZero) Constructs a config key for acquiring BinSizers.static StringReturns an XML string describing in general terms how to operate the BinSizer config key.abstract doublegetScaleWidth(Scale scale, double dlo, double dhi, boolean rounded) Provides a bin width value in scale units for a given axis data range.
-
Constructor Details
-
BinSizer
public BinSizer()
-
-
Method Details
-
getScaleWidth
Provides a bin width value in scale units for a given axis data range.- Parameters:
scale- axis scalingdlo- data value lower bounddhi- data value upper boundrounded- if true, an attempt may be made to provide a width that corresponds to some kind of round number; this hint may be ignored- Returns:
- scale interval appropriate for the given range
-
createFixedBinSizer
Returns a bin sizer instance which always returns the same fixed value. No rounding is performed.- Parameters:
scaleWidth- fixed bin width in scale units- Returns:
- bin sizer
-
createCountBinSizer
Returns a bin sizer instance which divides the axis range up into an approximately fixed number of equal intervals. Rounding is performed on request, so that bin sizes are sensible values that give a bin count near the requested value.- Parameters:
nbin- number of intervals to divide the axis into- Returns:
- bin sizer instance
-
createSizerConfigKey
public static ConfigKey<BinSizer> createSizerConfigKey(ConfigMeta meta, ReportKey<Double> widthReportKey, int dfltNbin, boolean allowZero) Constructs a config key for acquiring BinSizers.- Parameters:
meta- key metadatawidthReportKey- report key giving bin width in data coordinatesdfltNbin- default bin countallowZero- true iff zero is an allowed width- Returns:
- new config key
-
getConfigKeyDescription
Returns an XML string describing in general terms how to operate the BinSizer config key.- Returns:
- XML <p> element(s)
-