visad.util
Class BarGraph
- java.lang.Object
-
- visad.util.BarGraph
-
public class BarGraph extends java.lang.ObjectBarGraph provides methods for plotting colored bar graphs in 2D or 3D.
-
-
Constructor Summary
Constructors Constructor and Description BarGraph()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static float[][]extractColors(java.awt.Color[] c)Converts java.awt.Color objects to floating point RGB values.static voidmain(java.lang.String[] argv)Run 'java visad.util.BarGraph' to test bar graphing.static FlatFieldmakeBarGraph2D(float[] heights, float spacing, java.awt.Color[] colors)Constructs a 2D bar graph.static FlatFieldmakeBarGraph2D(FunctionType type, float[] heights, float spacing, java.awt.Color[] colors)Constructs a 2D bar graph.static FlatFieldmakeBarGraph3D(float[][] heights, float spacing, java.awt.Color[][] colors)Constructs a 3D bar graph.static FlatFieldmakeBarGraph3D(FunctionType type, float[][] heights, float spacing, java.awt.Color[][] colors)Constructs a 3D bar graph.static FlatFieldmakeBoxes2D(float[] x1, float[] y1, float[] x2, float[] y2, java.awt.Color[] c)static FlatFieldmakeBoxes2D(float[] x1, float[] y1, float[] x2, float[] y2, float[] r, float[] g, float[] b)static FlatFieldmakeBoxes2D(FunctionType type, float[] x1, float[] y1, float[] x2, float[] y2, java.awt.Color[] c)static FlatFieldmakeBoxes2D(FunctionType type, float[] x1, float[] y1, float[] x2, float[] y2, float[] r, float[] g, float[] b)static FlatFieldmakeBoxes3D(float[] x1, float[] y1, float[] z1, float[] x2, float[] y2, float[] z2, java.awt.Color[] c)static FlatFieldmakeBoxes3D(float[] x1, float[] y1, float[] z1, float[] x2, float[] y2, float[] z2, float[] r, float[] g, float[] b)static FlatFieldmakeBoxes3D(FunctionType type, float[] x1, float[] y1, float[] z1, float[] x2, float[] y2, float[] z2, java.awt.Color[] c)static FlatFieldmakeBoxes3D(FunctionType type, float[] x1, float[] y1, float[] z1, float[] x2, float[] y2, float[] z2, float[] r, float[] g, float[] b)
-
-
-
Method Detail
-
makeBarGraph2D
public static FlatField makeBarGraph2D(float[] heights, float spacing, java.awt.Color[] colors) throws VisADException, java.rmi.RemoteException
Constructs a 2D bar graph.- Parameters:
heights- Height of each barspacing- Spacing between bars (at least 0, and less than 1)colors- Color of each bar- Throws:
VisADExceptionjava.rmi.RemoteException
-
makeBarGraph2D
public static FlatField makeBarGraph2D(FunctionType type, float[] heights, float spacing, java.awt.Color[] colors) throws VisADException, java.rmi.RemoteException
Constructs a 2D bar graph.- Parameters:
type- MathType to use, of the form ((X, Y) -> (R, G, B))heights- Height of each barspacing- Spacing between bars (at least 0, and less than 1)colors- Color of each bar- Throws:
VisADExceptionjava.rmi.RemoteException
-
makeBoxes2D
public static FlatField makeBoxes2D(float[] x1, float[] y1, float[] x2, float[] y2, java.awt.Color[] c) throws VisADException, java.rmi.RemoteException
- Throws:
VisADExceptionjava.rmi.RemoteException
-
makeBoxes2D
public static FlatField makeBoxes2D(float[] x1, float[] y1, float[] x2, float[] y2, float[] r, float[] g, float[] b) throws VisADException, java.rmi.RemoteException
- Throws:
VisADExceptionjava.rmi.RemoteException
-
makeBoxes2D
public static FlatField makeBoxes2D(FunctionType type, float[] x1, float[] y1, float[] x2, float[] y2, java.awt.Color[] c) throws VisADException, java.rmi.RemoteException
- Throws:
VisADExceptionjava.rmi.RemoteException
-
makeBoxes2D
public static FlatField makeBoxes2D(FunctionType type, float[] x1, float[] y1, float[] x2, float[] y2, float[] r, float[] g, float[] b) throws VisADException, java.rmi.RemoteException
- Throws:
VisADExceptionjava.rmi.RemoteException
-
makeBarGraph3D
public static FlatField makeBarGraph3D(float[][] heights, float spacing, java.awt.Color[][] colors) throws VisADException, java.rmi.RemoteException
Constructs a 3D bar graph.- Parameters:
heights- Height of each bar (dimensioned cols X rows)spacing- Spacing between bars (at least 0, and less than 1)colors- Color of each bar (dimensioned cols X rows)- Throws:
VisADExceptionjava.rmi.RemoteException
-
makeBarGraph3D
public static FlatField makeBarGraph3D(FunctionType type, float[][] heights, float spacing, java.awt.Color[][] colors) throws VisADException, java.rmi.RemoteException
Constructs a 3D bar graph.- Parameters:
type- MathType to use, of the form ((X, Y, Z) -> (R, G, B))heights- Height of each bar (dimensioned cols X rows)spacing- Spacing between bars (at least 0, and less than 1)colors- Color of each bar (dimensioned cols X rows)- Throws:
VisADExceptionjava.rmi.RemoteException
-
makeBoxes3D
public static FlatField makeBoxes3D(float[] x1, float[] y1, float[] z1, float[] x2, float[] y2, float[] z2, java.awt.Color[] c) throws VisADException, java.rmi.RemoteException
- Throws:
VisADExceptionjava.rmi.RemoteException
-
makeBoxes3D
public static FlatField makeBoxes3D(float[] x1, float[] y1, float[] z1, float[] x2, float[] y2, float[] z2, float[] r, float[] g, float[] b) throws VisADException, java.rmi.RemoteException
- Throws:
VisADExceptionjava.rmi.RemoteException
-
makeBoxes3D
public static FlatField makeBoxes3D(FunctionType type, float[] x1, float[] y1, float[] z1, float[] x2, float[] y2, float[] z2, java.awt.Color[] c) throws VisADException, java.rmi.RemoteException
- Throws:
VisADExceptionjava.rmi.RemoteException
-
makeBoxes3D
public static FlatField makeBoxes3D(FunctionType type, float[] x1, float[] y1, float[] z1, float[] x2, float[] y2, float[] z2, float[] r, float[] g, float[] b) throws VisADException, java.rmi.RemoteException
- Throws:
VisADExceptionjava.rmi.RemoteException
-
extractColors
public static float[][] extractColors(java.awt.Color[] c)
Converts java.awt.Color objects to floating point RGB values.
-
main
public static void main(java.lang.String[] argv) throws VisADException, java.rmi.RemoteExceptionRun 'java visad.util.BarGraph' to test bar graphing.- Throws:
VisADExceptionjava.rmi.RemoteException
-
-
DMelt 3.0 © DataMelt by jWork.ORG