Package org.moeaframework.analysis.plot
Class HeatMapBuilder
java.lang.Object
org.moeaframework.analysis.plot.PlotBuilder<HeatMapBuilder>
org.moeaframework.analysis.plot.HeatMapBuilder
Constructs a 2D heat map. The map is a raster produced from a 2D grid, defined by the X and Y coordinates, and a
paint scale that maps values to colors.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.moeaframework.analysis.plot.PlotBuilder
PlotBuilder.DisplayDriver
-
Field Summary
Fields inherited from class org.moeaframework.analysis.plot.PlotBuilder
paintHelper
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.jfree.chart.JFreeChart
build()
Builds and returns the configured plot.data
(Partition<? extends org.apache.commons.lang3.tuple.Pair<? extends Number, ? extends Number>, ? extends Number> partition, StyleAttribute... style) Sets the X, Y, and Z values based on aPartition
.protected HeatMapBuilder
Returns an instance of this builder cast to the concrete implementation typePlotBuilder
.style
(PlotAttribute... attributes) Sets the style of the heat map.xCoords
(double[] x) Sets the X coordinates defining the grid.Sets the X coordinates defining the grid.Sets the X axis label.yCoords
(double[] y) Sets the Y coordinates defining the grid.Sets the Y coordinates defining the grid.Sets the Y axis label.zData
(double[][] z) Sets the Z data that define the color of each grid coordinate.Sets the Z data that define the color of each grid coordinate.Sets the Z axis label.Methods inherited from class org.moeaframework.analysis.plot.PlotBuilder
applyStyle, applyStyle, barGraph, boxAndWhisker, build, buildPanel, defaultLegend, getAttribute, getDisplayDriver, getValueOrDefault, getValueOrDefault, hasAttribute, heatMap, legend, noLegend, paintHelper, save, save, save, sensitivity, setDisplayDriver, show, show, subtitle, theme, title, to2DArray, toArray, toArray, xy
-
Constructor Details
-
HeatMapBuilder
public HeatMapBuilder()Constructs a new, empty heat map builder.
-
-
Method Details
-
getInstance
Description copied from class:PlotBuilder
Returns an instance of this builder cast to the concrete implementation typePlotBuilder
. This is used by any intermediate classes to returns the concrete implementation.- Specified by:
getInstance
in classPlotBuilder<HeatMapBuilder>
- Returns:
- a reference to this builder instance
-
build
public org.jfree.chart.JFreeChart build()Description copied from class:PlotBuilder
Builds and returns the configured plot.- Specified by:
build
in classPlotBuilder<HeatMapBuilder>
- Returns:
- the resulting plot
-
xLabel
Sets the X axis label.- Parameters:
label
- the label for the X axis- Returns:
- a reference to this builder
-
yLabel
Sets the Y axis label.- Parameters:
label
- the label for the Y axis- Returns:
- a reference to this builder
-
zLabel
Sets the Z axis label.- Parameters:
label
- the label for the Z axis- Returns:
- a reference to this builder
-
xCoords
Sets the X coordinates defining the grid.- Parameters:
x
- the X coordinates- Returns:
- a reference to this builder
-
xCoords
Sets the X coordinates defining the grid.- Parameters:
x
- the X coordinates- Returns:
- a reference to this builder
-
yCoords
Sets the Y coordinates defining the grid.- Parameters:
y
- the Y coordinates- Returns:
- a reference to this builder
-
yCoords
Sets the Y coordinates defining the grid.- Parameters:
y
- the Y coordinates- Returns:
- a reference to this builder
-
zData
Sets the Z data that define the color of each grid coordinate.- Parameters:
z
- the Z values- Returns:
- a reference to this builder
-
zData
Sets the Z data that define the color of each grid coordinate.- Parameters:
z
- the Z values- Returns:
- a reference to this builder
-
style
Sets the style of the heat map.- Parameters:
attributes
- the attributes configuring the plot- Returns:
- a reference to this builder
-
data
public HeatMapBuilder data(Partition<? extends org.apache.commons.lang3.tuple.Pair<? extends Number, ? extends Number>, ? extends Number> partition, StyleAttribute... style) Sets the X, Y, and Z values based on aPartition
.- Parameters:
partition
- the data stream partitionstyle
- the style attributes- Returns:
- a reference to this instance
-