org.generation5.util
Class PlotGrid

java.lang.Object
  extended byorg.generation5.util.Plot
      extended byorg.generation5.util.PlotGrid
All Implemented Interfaces:
Visualizable

public class PlotGrid
extends Plot

Plot data as a two-dimensional grid. Data can be passed as either a two-dimensional array of PlotPoints, or as a three-dimensional array of doubles. This class was primarily designed to facilitate the visualization of Kohonen neural network weights, but should work well in most other situations too.

See Also:
PlotPoint, KohonenNN

Field Summary
protected  PlotPoint[][] gridPoints1
          A two dimensional array of the grid points.
protected  double[][][] gridPoints2
          The grid points as a three-dimensional array of doubles.
 
Fields inherited from class org.generation5.util.Plot
drawAxes, maxX, maxY, minX, minY, plotTypes
 
Constructor Summary
PlotGrid()
          Creates a new instance of PlotGrid
 
Method Summary
 void render(java.awt.Graphics g, int width, int height)
          Render the grid on a graphics context.
 void setGridPoints(double[][][] gridPoints)
          Set the grid points as a three-dimensional array of doubles.
 void setGridPoints(PlotPoint[][] gridPoints)
          Set the grid points as a two-dimensional array of PlotPoints.
 
Methods inherited from class org.generation5.util.Plot
calculateRanges, drawAxes, getMaximumX, getMaximumY, getMinimumX, getMinimumY, getRangeX, getRangeY, setDrawAxes, setMaximumX, setMaximumY, setMinimumX, setRange, translateCoordinate, translateCoordinate, writeImage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

gridPoints1

protected PlotPoint[][] gridPoints1
A two dimensional array of the grid points.


gridPoints2

protected double[][][] gridPoints2
The grid points as a three-dimensional array of doubles.

Constructor Detail

PlotGrid

public PlotGrid()
Creates a new instance of PlotGrid

Method Detail

setGridPoints

public void setGridPoints(PlotPoint[][] gridPoints)
Set the grid points as a two-dimensional array of PlotPoints. Note that this will set any data set with setGridPoints(double[][][]) to null.

Parameters:
gridPoints - a two-dimensional array of PlotPoints.

setGridPoints

public void setGridPoints(double[][][] gridPoints)
Set the grid points as a three-dimensional array of doubles. Note that this will set any data set with setGridPoints(PlotPoint[][]) to null.

Parameters:
gridPoints - the grid points.

render

public void render(java.awt.Graphics g,
                   int width,
                   int height)
Render the grid on a graphics context.

Specified by:
render in interface Visualizable
Specified by:
render in class Plot
Parameters:
g - the graphics context.
width - the width of the context.
height - the height of the context.

This documentation is part of the Generation5 JDK.