Package smile.plot.swing
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
ConstructorDescriptionSparseMatrixPlot
(SparseMatrix sparse, Color color) Constructor.SparseMatrixPlot
(SparseMatrix sparse, Color[] palette) Constructor. -
Method Summary
Modifier and TypeMethodDescriptioncanvas()
Returns a canvas of the plot.double[]
Returns the lower bound of data.double[]
Returns the upper bound of data.static SparseMatrixPlot
of
(SparseMatrix sparse) Creates a sparse matrix plot with blue color for nonzero entries.static SparseMatrixPlot
of
(SparseMatrix sparse, int k) Creates a sparse matrix plot with the jet color palette.void
Draws the shape.
-
Constructor Details
-
SparseMatrixPlot
Constructor. -
SparseMatrixPlot
Constructor.- Parameters:
palette
- the color palette.
-
-
Method Details
-
getLowerBound
public double[] getLowerBound()Description copied from class:Plot
Returns the lower bound of data.- Specified by:
getLowerBound
in classPlot
-
getUpperBound
public double[] getUpperBound()Description copied from class:Plot
Returns the upper bound of data.- Specified by:
getUpperBound
in classPlot
-
paint
Description copied from class:Shape
Draws the shape. -
canvas
Description copied from class:Plot
Returns a canvas of the plot. -
of
Creates a sparse matrix plot with blue color for nonzero entries. -
of
Creates a sparse matrix plot with the jet color palette.- Parameters:
k
- the number of colors in the palette.
-