public class Stats1Plotter extends Object implements Plotter<Stats1Plotter.StatsStyle>
Modifier and Type | Class and Description |
---|---|
static class |
Stats1Plotter.StatsStyle
Style class associated with this plotter.
|
Modifier and Type | Field and Description |
---|---|
static ConfigKey<BinSizer> |
BINSIZER_KEY
Config key for equivalent histogram bar width.
|
static ReportKey<Double> |
CONST_KEY
Report key for fitted multiplicative constant.
|
static ReportKey<String> |
FUNCTION_KEY
Report key for gaussian fit function.
|
static ReportKey<Double> |
MEAN_KEY
Report key for fitted mean.
|
static ConfigKey<Normalisation> |
NORMALISE_KEY
Config key for normalisation.
|
static ConfigKey<Boolean> |
SHOWMEAN_KEY
Config key to display a line at the mean value.
|
static ReportKey<Double> |
STDEV_KEY
Report key for fitted standard deviation.
|
Constructor and Description |
---|
Stats1Plotter(FloatingCoord xCoord,
boolean hasWeight,
ConfigKey<Unit> unitKey)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
PlotLayer |
createLayer(DataGeom geom,
DataSpec dataSpec,
Stats1Plotter.StatsStyle style)
Creates a PlotLayer based on the given geometry, data and style.
|
Stats1Plotter.StatsStyle |
createStyle(ConfigMap config)
Creates a style that can be used when creating a plot layer.
|
CoordGroup |
getCoordGroup()
Returns an object describing which data coordinates are used for
this plotter and how they are arranged in supplied DataSpec objects.
|
String |
getPlotterDescription()
Returns an XML description of this plotter.
|
Icon |
getPlotterIcon()
Returns an icon for this plotter for use in user interface.
|
String |
getPlotterName()
Returns the name of this plotter for use in user interface.
|
Object |
getRangeStyleKey(Stats1Plotter.StatsStyle style)
Returns an opaque object characterising the region of the plot surface
covered when using a given plotter style.
|
ConfigKey<?>[] |
getStyleKeys()
Returns the configuration keys used to configure style for this plotter.
|
boolean |
hasReports()
Indicates whether the drawings produced by this plotter will
return general interest report information to upstream plotting code.
|
public static final ReportKey<Double> CONST_KEY
public static final ReportKey<String> FUNCTION_KEY
public static final ConfigKey<BinSizer> BINSIZER_KEY
public static final ConfigKey<Normalisation> NORMALISE_KEY
public Stats1Plotter(FloatingCoord xCoord, boolean hasWeight, ConfigKey<Unit> unitKey)
xCoord
- X axis coordinatehasWeight
- true if weights may be usedunitKey
- config key to select X axis physical units,
or null if no unit selection requiredpublic String getPlotterName()
Plotter
getPlotterName
in interface Plotter<Stats1Plotter.StatsStyle>
public Icon getPlotterIcon()
Plotter
getPlotterIcon
in interface Plotter<Stats1Plotter.StatsStyle>
public boolean hasReports()
Plotter
hasReports
in interface Plotter<Stats1Plotter.StatsStyle>
Drawing.getReport(java.lang.Object)
public String getPlotterDescription()
Plotter
Note: really this should appear at the LayerType level.
getPlotterDescription
in interface Plotter<Stats1Plotter.StatsStyle>
public CoordGroup getCoordGroup()
Plotter
getCoordGroup
in interface Plotter<Stats1Plotter.StatsStyle>
public ConfigKey<?>[] getStyleKeys()
Plotter
Plotter.createStyle(uk.ac.starlink.ttools.plot2.config.ConfigMap)
method.getStyleKeys
in interface Plotter<Stats1Plotter.StatsStyle>
public Stats1Plotter.StatsStyle createStyle(ConfigMap config)
Plotter
Plotter.getStyleKeys()
.
The return value can be used as input to Plotter.createLayer(uk.ac.starlink.ttools.plot2.DataGeom, uk.ac.starlink.ttools.plot2.data.DataSpec, S)
.createStyle
in interface Plotter<Stats1Plotter.StatsStyle>
config
- map of style configuration itemspublic Object getRangeStyleKey(Stats1Plotter.StatsStyle style)
Plotter
extendCoordinateRanges
).
In many cases, such as scatter-plot-like plotters, the range
is determined only by the coordinate data
(managed by DataSpec
inputs)
so a null value may be returned.
This method is chiefly required by histogram-like plotters for which
the region on the plot surface is not the union of the input positions.
getRangeStyleKey
in interface Plotter<Stats1Plotter.StatsStyle>
style
- plot style to assesspublic PlotLayer createLayer(DataGeom geom, DataSpec dataSpec, Stats1Plotter.StatsStyle style)
Plotter
The style
parameter is the result of a call to
Plotter.createStyle(uk.ac.starlink.ttools.plot2.config.ConfigMap)
.
The dataSpec
parameter must contain the coordinates
defined by this plotter's CoordGroup.
The pointDataGeom
parameter is only used if the
CoordGroup.getBasicPositionCount()
or
CoordGroup.getExtraPositionCount()
method from this plotter's CoordGroup return a non-zero value,
otherwise the plot does not have point positions.
It is legal to supply null for any of the parameters; if insufficient data is supplied to generate a plot, then the method should return null.
Creating a layer should be cheap; layers may be created and not used.
createLayer
in interface Plotter<Stats1Plotter.StatsStyle>
geom
- indicates base position coordinates and their
mapping to points in the data spacedataSpec
- specifies the data required for the plotstyle
- data style as obtained from createStyle
Copyright © 2024 Central Laboratory of the Research Councils. All Rights Reserved.