Class SparseMatrixPlot
java.lang.Object
smile.plot.swing.Shape
smile.plot.swing.Plot
smile.plot.swing.SparseMatrixPlot
A graphical representation of sparse matrix data. Optionally, the values
in the matrix can be represented as colors.
-
Constructor Summary
ConstructorsConstructorDescriptionSparseMatrixPlot(SparseMatrix matrix, Color color) Constructor.SparseMatrixPlot(SparseMatrix matrix, Color[] palette) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionfigure()Returns a figure containing the plot.double[]Returns the lower bound of data.double[]Returns the upper bound of data.static SparseMatrixPlotof(SparseMatrix matrix) Creates a sparse matrix plot with blue color for nonzero entries.static SparseMatrixPlotof(SparseMatrix matrix, int k) Creates a sparse matrix plot with the jet color palette.voidDraws the shape.
-
Constructor Details
-
SparseMatrixPlot
Constructor.- Parameters:
matrix- the sparse matrix.color- the color of plot.
-
SparseMatrixPlot
Constructor.- Parameters:
matrix- the sparse matrix.palette- the color palette.
-
-
Method Details
-
getLowerBound
public double[] getLowerBound()Description copied from class:PlotReturns the lower bound of data.- Specified by:
getLowerBoundin classPlot- Returns:
- the lower bound of data.
-
getUpperBound
public double[] getUpperBound()Description copied from class:PlotReturns the upper bound of data.- Specified by:
getUpperBoundin classPlot- Returns:
- the upper bound of data.
-
paint
-
figure
-
of
Creates a sparse matrix plot with blue color for nonzero entries.- Parameters:
matrix- the sparse matrix.- Returns:
- the plot.
-
of
Creates a sparse matrix plot with the jet color palette.- Parameters:
matrix- the sparse matrix.k- the number of colors in the palette.- Returns:
- the plot.
-