Class DensogramPlotter
java.lang.Object
uk.ac.starlink.ttools.plot2.layer.Pixel1dPlotter<DensogramPlotter.DensoStyle>
uk.ac.starlink.ttools.plot2.layer.DensogramPlotter
- All Implemented Interfaces:
Plotter<DensogramPlotter.DensoStyle>
Plots a histogram-like density map - a one-dimensional colour bar
indicating density on the horizontal axis.
- Since:
- 20 Feb 2015
- Author:
- Mark Taylor
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classPlotting style for this class.Nested classes/interfaces inherited from class Pixel1dPlotter
Pixel1dPlotter.BinArray, Pixel1dPlotter.Pixel1dPlan -
Field Summary
FieldsModifier and TypeFieldDescriptionConfig key for the height of the density bar.Config key for the position of the density bar.static final RampKeySetConfig keyset for the colour ramp.Fields inherited from class Pixel1dPlotter
KERNEL_KEY, SMOOTHSIZER_KEY, SMOOTHWIDTH_KEY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateStyle(ConfigMap config) Creates a style that can be used when creating a plot layer.protected voidextendPixel1dCoordinateRanges(Range[] ranges, Scale[] scales, DensogramPlotter.DensoStyle style, DataSpec dataSpec, DataStore dataStore) Performs any required range extension.protected CombinerReturns the bin aggregation mode implied by a given style.protected LayerOptReturns the LayerOpt suitable for a given style for this plotter.protected ReportMapgetPixel1dReport(Pixel1dPlotter.Pixel1dPlan plan, DensogramPlotter.DensoStyle style, Scale xScale) Returns information associated with the plot.protected intgetPixelPadding(DensogramPlotter.DensoStyle style, PlanarSurface surf) Returns the padding required at both ends of the array of pixel bins for calculations.Returns an XML description of this plotter.Returns an opaque object characterising the region of the plot surface covered when using a given plotter style.ConfigKey<?>[]Returns the configuration keys used to configure style for this plotter.protected booleanisY(DensogramPlotter.DensoStyle style) Returns the sideways flag implied by a given style.protected voidpaintBins(PlanarSurface surface, Pixel1dPlotter.BinArray binArray, DensogramPlotter.DensoStyle style, Graphics2D g) Draws the graphical representation of a given array of counts per horizontal pixel.Methods inherited from class Pixel1dPlotter
createKernel, createLayer, getCombinerKey, getCoordGroup, getDataBins, getEffectiveExtent, getPixelWidth, getPlotterIcon, getPlotterName, getWeightCoordIndex, getWeightingDescription, hasReports, readBins
-
Field Details
-
RAMP_KEYSET
Config keyset for the colour ramp. -
EXTENT_KEY
-
POSITION_KEY
-
-
Constructor Details
-
DensogramPlotter
Constructor.- Parameters:
xCoord- X axis coordinatehasWeight- true to permit histogram weighting
-
-
Method Details
-
getPlotterDescription
-
getStyleKeys
Description copied from interface:PlotterReturns the configuration keys used to configure style for this plotter. The keys in the return value are used in the map supplied to thePlotter.createStyle(ConfigMap)method.- Returns:
- keys used when creating a style for this plotter.
-
createStyle
Description copied from interface:PlotterCreates a style that can be used when creating a plot layer. The keys that are significant in the supplied config map are those returned byPlotter.getStyleKeys(). The return value can be used as input toPlotter.createLayer(DataGeom, DataSpec, S).- Parameters:
config- map of style configuration items- Returns:
- plotter-specific plot style
-
getRangeStyleKey
Description copied from interface:PlotterReturns an opaque object characterising the region of the plot surface covered when using a given plotter style. If this object changes between layers produced by this plotter, it provides a hint that it may be necessary to redetermine the axis ranges (usingextendCoordinateRanges).In many cases, such as scatter-plot-like plotters, the range is determined only by the coordinate data (managed by
DataSpecinputs) 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.- Parameters:
style- plot style to assess- Returns:
- opaque object with equality semantics, or null if axis range is not a function of style
-
paintBins
protected void paintBins(PlanarSurface surface, Pixel1dPlotter.BinArray binArray, DensogramPlotter.DensoStyle style, Graphics2D g) Description copied from class:Pixel1dPlotterDraws the graphical representation of a given array of counts per horizontal pixel.- Specified by:
paintBinsin classPixel1dPlotter<DensogramPlotter.DensoStyle>- Parameters:
surface- plotting surfacebinArray- counts per X axis pixelstyle- plotting styleg- graphics context
-
isY
Description copied from class:Pixel1dPlotterReturns the sideways flag implied by a given style.- Specified by:
isYin classPixel1dPlotter<DensogramPlotter.DensoStyle>- Parameters:
style- plot style- Returns:
- if true, plot is sideways
-
getLayerOpt
Description copied from class:Pixel1dPlotterReturns the LayerOpt suitable for a given style for this plotter.- Specified by:
getLayerOptin classPixel1dPlotter<DensogramPlotter.DensoStyle>- Parameters:
style- plot style- Returns:
- layer option flags
-
getPixelPadding
Description copied from class:Pixel1dPlotterReturns the padding required at both ends of the array of pixel bins for calculations.- Specified by:
getPixelPaddingin classPixel1dPlotter<DensogramPlotter.DensoStyle>- Parameters:
style- plotting stylesurf- plotting surface- Returns:
- padding in pixels required in bin array
-
getCombiner
Description copied from class:Pixel1dPlotterReturns the bin aggregation mode implied by a given style.- Specified by:
getCombinerin classPixel1dPlotter<DensogramPlotter.DensoStyle>- Parameters:
style- plotting style- Returns:
- pixel bin aggregation mode
-
extendPixel1dCoordinateRanges
protected void extendPixel1dCoordinateRanges(Range[] ranges, Scale[] scales, DensogramPlotter.DensoStyle style, DataSpec dataSpec, DataStore dataStore) Description copied from class:Pixel1dPlotterPerforms any required range extension. May be a no-op.- Specified by:
extendPixel1dCoordinateRangesin classPixel1dPlotter<DensogramPlotter.DensoStyle>- Parameters:
ranges- array of data space dimension ranges to updatescales- array of axis scales corresponding to rangesstyle- plotting styledataSpec- data specificationdataStore- data storage object- See Also:
-
getPixel1dReport
protected ReportMap getPixel1dReport(Pixel1dPlotter.Pixel1dPlan plan, DensogramPlotter.DensoStyle style, Scale xScale) Description copied from class:Pixel1dPlotterReturns information associated with the plot.- Specified by:
getPixel1dReportin classPixel1dPlotter<DensogramPlotter.DensoStyle>- Parameters:
plan- plotting planstyle- plot stylexScale- scaling on X axis- Returns:
- report info, may be null
- See Also:
-