public class RasterPlot extends XYPlot
Class that displays two coordinate values and a value as a raster of boxes. The data source must provide at least three columns:
The method createRasterData(DataSource)
can be used to convert
a matrix of values to the (coordinates, value) format.
To create a new RasterPlot
simply create a new instance using
a suitable data source. Example:
DataTable data = new DataTable(Double.class, Double.class); data.add(10.98, -12.34); data.add( 7.65, 45.67); data.add(43.21, 89.01); DataSource rasterData = RasterPlot.createRasterData(data); RasterPlot plot = new RasterPlot(rasterData);
Modifier and Type | Class and Description |
---|---|
protected static class |
RasterPlot.RasterRenderer
Class that renders a box and its whiskers in a box-and-whisker plot.
|
XYPlot.XYLegend, XYPlot.XYNavigationDirection, XYPlot.XYPlotArea2D, XYPlot.XYPlotNavigator
Modifier and Type | Field and Description |
---|---|
static Key |
COLORS
Key for specifying an instance of
ColorMapper used for mapping the
pixel values to colors. |
static Key |
DISTANCE
Key for specifying a
Dimension2D instance which
defines the horizontal and vertical distance of the raster pixels. |
static Key |
OFFSET
Key for specifying a
Point2D instance which defines
the horizontal and vertical offset of the raster from the origin. |
BACKGROUND, BORDER, COLOR, LEGEND, LEGEND_DISTANCE, LEGEND_LOCATION, TITLE, TITLE_FONT
Constructor and Description |
---|
RasterPlot(DataSource data)
Initializes a new box-and-whisker plot with the specified data source.
|
Modifier and Type | Method and Description |
---|---|
void |
add(int index,
DataSource source,
boolean visible)
Inserts the specified data series to the plot at a specified position.
|
void |
autoscaleAxis(String axisName)
Tries to automatically set the ranges of the axes specified by the name
if it is set to auto-scale.
|
static DataSource |
createRasterData(DataSource data)
Takes a matrix of values and creates a new data source that stores the
values in (x, y, value) format.
|
createDefaultAxes, createDefaultAxisRenderers, draw, getAreaRenderer, getLineRenderer, getNavigator, getPointRenderer, layoutAxes, rangeChanged, setAreaRenderer, setAxisRenderer, setLineRenderer, setPointRenderer
add, add, autoscaleAxes, clear, contains, dataAdded, dataChanged, dataRemoved, dataUpdated, drawAxes, drawLegend, get, getAxesNames, getAxis, getAxisComponent, getAxisMax, getAxisMin, getAxisRenderer, getData, getLegend, getLegendContainer, getMapping, getPlotArea, getTitle, getVisibleData, isVisible, layout, layoutLegend, remove, removeAxis, setAxis, setLegend, setMapping, setPlotArea, settingChanged, setVisible
getSetting, removeSetting, removeSettingDefault, setSetting, setSettingDefault
add, add, drawComponents, getConstraints, getDrawableAt, getInsets, getLayout, getPreferredSize, iterator, remove, setBounds, setBounds, setInsets, setLayout, size
getBounds, getHeight, getWidth, getX, getY
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getBounds, getHeight, getPreferredSize, getWidth, getX, getY, setBounds, setBounds
add, add, getBounds, getConstraints, getDrawableAt, getInsets, getLayout, remove, setBounds, setInsets, setLayout, size
getSetting, removeSetting, removeSettingDefault, setSetting, setSettingDefault
public static final Key OFFSET
Point2D
instance which defines
the horizontal and vertical offset of the raster from the origin.public static final Key DISTANCE
Dimension2D
instance which
defines the horizontal and vertical distance of the raster pixels.public static final Key COLORS
ColorMapper
used for mapping the
pixel values to colors.public RasterPlot(DataSource data)
data
- Data to be displayed.public void autoscaleAxis(String axisName)
AbstractPlot
autoscaleAxis
in interface Plot
autoscaleAxis
in class AbstractPlot
axisName
- Name of the axis that should be scaled.Axis.setAutoscaled(boolean)
public static DataSource createRasterData(DataSource data)
data
- Original data source with values in each cell.public void add(int index, DataSource source, boolean visible)
AbstractPlot
Copyright © 2009-2013. All Rights Reserved.