Plotter<S>
AbstractKernelDensityPlotter
, DensogramPlotter
public abstract class Pixel1dPlotter<S extends Style> extends java.lang.Object implements Plotter<S>
Modifier and Type | Class | Description |
---|---|---|
static class |
Pixel1dPlotter.BinArray |
Data object storing counts per pixel.
|
static class |
Pixel1dPlotter.Pixel1dPlan |
Plot plan implementation for this class.
|
Modifier and Type | Field | Description |
---|---|---|
static ConfigKey<Kernel1dShape> |
KERNEL_KEY |
Config key for smoothing kernel shape.
|
static ConfigKey<BinSizer> |
SMOOTHSIZER_KEY |
Config key for smoothing width configuration.
|
static ReportKey<java.lang.Double> |
SMOOTHWIDTH_KEY |
Report key for smoothing width.
|
Modifier | Constructor | Description |
---|---|---|
protected |
Pixel1dPlotter(FloatingCoord xCoord,
boolean hasWeight,
ConfigKey<Unit> unitKey,
java.lang.String name,
javax.swing.Icon icon) |
Constructor.
|
Modifier and Type | Method | Description |
---|---|---|
static Kernel1d |
createKernel(Kernel1dShape kernelShape,
BinSizer sizer,
Axis xAxis,
boolean xLog,
boolean isMean) |
Creates a new kernel from configuration items.
|
PlotLayer |
createLayer(DataGeom geom,
DataSpec dataSpec,
S style) |
The supplied
geom is ignored. |
protected abstract void |
extendPixel1dCoordinateRanges(Range[] ranges,
boolean[] logFlags,
S style,
DataSpec dataSpec,
DataStore dataStore) |
Performs any required range extension.
|
protected abstract Combiner |
getCombiner(S style) |
Returns the bin aggregation mode implied by a given style.
|
ConfigKey<Combiner> |
getCombinerKey() |
Returns the combination mode configuration key for this plotter.
|
CoordGroup |
getCoordGroup() |
Returns an object describing which data coordinates are used for
this plotter and how they are arranged in supplied DataSpec objects.
|
static double[] |
getDataBins(Pixel1dPlotter.BinArray binArray,
Axis xAxis,
Kernel1d kernel,
Normalisation norm,
Combiner.Type ctype,
Unit unit,
boolean cumul) |
Returns an array of data coordinate values, one for each bin
accumulated by the bin array (X pixel value).
|
static int |
getEffectiveExtent(Kernel1d kernel) |
Returns the range of a given kernel over which it will be evaluated
for the purposes of this plotter.
|
protected abstract LayerOpt |
getLayerOpt(S style) |
Returns the LayerOpt suitable for a given style for this plotter.
|
protected abstract ReportMap |
getPixel1dReport(Pixel1dPlotter.Pixel1dPlan plan,
S style,
boolean xLog) |
Returns information associated with the plot.
|
protected abstract int |
getPixelPadding(S style,
PlanarSurface surf) |
Returns the padding required at both ends of the array of
pixel bins for calculations.
|
static double |
getPixelWidth(BinSizer sizer,
Axis xAxis,
boolean xLog) |
Calculates the width in pixel coordinates represented by a
bin sizer applied to a given axis.
|
javax.swing.Icon |
getPlotterIcon() |
Returns an icon for this plotter for use in user interface.
|
java.lang.String |
getPlotterName() |
Returns the name of this plotter for use in user interface.
|
int |
getWeightCoordIndex() |
Returns the DataSpec coord index used for the weighting data
for this plotter.
|
protected java.lang.String |
getWeightingDescription() |
Returns an XML description snippet (zero or more P elements)
discussing use of weighted coordinates for this plotter.
|
boolean |
hasReports() |
Indicates whether the drawings produced by this plotter will
return general interest report information to upstream plotting code.
|
protected abstract void |
paintBins(PlanarSurface surface,
Pixel1dPlotter.BinArray binArray,
S style,
java.awt.Graphics2D g) |
Draws the graphical representation of a given array of counts per
horizontal pixel.
|
Pixel1dPlotter.BinArray |
readBins(Axis xAxis,
int padPix,
Combiner combiner,
DataSpec dataSpec,
DataStore dataStore) |
Reads per-horizontal-pixel frequency data from a given data set.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createStyle, getPlotterDescription, getStyleKeys
public static final ReportKey<java.lang.Double> SMOOTHWIDTH_KEY
public static final ConfigKey<BinSizer> SMOOTHSIZER_KEY
public static final ConfigKey<Kernel1dShape> KERNEL_KEY
protected Pixel1dPlotter(FloatingCoord xCoord, boolean hasWeight, ConfigKey<Unit> unitKey, java.lang.String name, javax.swing.Icon icon)
xCoord
- X axis coordinatehasWeight
- true to permit histogram weightingunitKey
- config key to select X axis physical units,
or null if no unit selection requiredname
- plotter nameicon
- plotter iconpublic java.lang.String getPlotterName()
Plotter
getPlotterName
in interface Plotter<S extends Style>
public javax.swing.Icon getPlotterIcon()
Plotter
getPlotterIcon
in interface Plotter<S extends Style>
public CoordGroup getCoordGroup()
Plotter
getCoordGroup
in interface Plotter<S extends Style>
public boolean hasReports()
Plotter
hasReports
in interface Plotter<S extends Style>
Drawing.getReport(java.lang.Object)
protected java.lang.String getWeightingDescription()
protected abstract LayerOpt getLayerOpt(S style)
style
- plot styleprotected abstract int getPixelPadding(S style, PlanarSurface surf)
style
- plotting stylesurf
- plotting surfaceprotected abstract Combiner getCombiner(S style)
style
- plotting styleprotected abstract void paintBins(PlanarSurface surface, Pixel1dPlotter.BinArray binArray, S style, java.awt.Graphics2D g)
surface
- plotting surfacebinArray
- counts per X axis pixelstyle
- plotting styleg
- graphics contextprotected abstract void extendPixel1dCoordinateRanges(Range[] ranges, boolean[] logFlags, S style, DataSpec dataSpec, DataStore dataStore)
ranges
- array of data space dimension ranges to updatelogFlags
- array of linear/log flags corresponding to rangesstyle
- plotting styledataSpec
- data specificationdataStore
- data storage objectPlotLayer.extendCoordinateRanges(uk.ac.starlink.ttools.plot.Range[], boolean[], uk.ac.starlink.ttools.plot2.data.DataStore)
protected abstract ReportMap getPixel1dReport(Pixel1dPlotter.Pixel1dPlan plan, S style, boolean xLog)
plan
- plotting planstyle
- plot stylexLog
- true iff X axis is logarithmicDrawing.getReport(java.lang.Object)
public ConfigKey<Combiner> getCombinerKey()
public PlotLayer createLayer(DataGeom geom, DataSpec dataSpec, S style)
geom
is ignored.createLayer
in interface Plotter<S extends Style>
geom
- indicates base position coordinates and their
mapping to points in the data space;
if non-null, the data geom's
DataGeom.hasPosition()
method will return truedataSpec
- specifies the data required for the plotstyle
- data style as obtained from createStyle
public int getWeightCoordIndex()
public Pixel1dPlotter.BinArray readBins(Axis xAxis, int padPix, Combiner combiner, DataSpec dataSpec, DataStore dataStore)
xAxis
- axis along which frequencies are accumulatedpadPix
- number of pixels in each direction
outside of the axis range over which counts should
be gatheredcombiner
- bin aggregation modedataSpec
- specification for frequency data valuesdataStore
- data storagepublic static double[] getDataBins(Pixel1dPlotter.BinArray binArray, Axis xAxis, Kernel1d kernel, Normalisation norm, Combiner.Type ctype, Unit unit, boolean cumul)
binArray
- basic resultsxAxis
- axis over which counts are accumulatedkernel
- smoothing kernelnorm
- normalisation modectype
- combiner type used to populate binsunit
- unit for scaling X axis bin widthcumul
- true for cumulative representationpublic static int getEffectiveExtent(Kernel1d kernel)
kernel
- public static Kernel1d createKernel(Kernel1dShape kernelShape, BinSizer sizer, Axis xAxis, boolean xLog, boolean isMean)
kernelShape
- functional formsizer
- determines width in data coordinatesxAxis
- axis on which samples occurxLog
- true for logarithmic x axis, false for linearisMean
- true if the smoothing is to suitable for
intensive quantities like the mean,
false for extensive quantities like a sumpublic static double getPixelWidth(BinSizer sizer, Axis xAxis, boolean xLog)
sizer
- determines width in data coordinatesxAxis
- axis on which samples occurxLog
- true for logarithmic x axis, false for linearCopyright © 2018 Central Laboratory of the Research Councils. All Rights Reserved.