Class SparseMatrixPlot


public class SparseMatrixPlot extends Plot
A graphical representation of sparse matrix data. Optionally, the values in the matrix can be represented as colors.
  • Constructor Details

    • SparseMatrixPlot

      public SparseMatrixPlot(SparseMatrix matrix, Color color)
      Constructor.
      Parameters:
      matrix - the sparse matrix.
      color - the color of plot.
    • SparseMatrixPlot

      public SparseMatrixPlot(SparseMatrix matrix, Color[] palette)
      Constructor.
      Parameters:
      matrix - the sparse matrix.
      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 class Plot
      Returns:
      the lower bound of data.
    • getUpperBound

      public double[] getUpperBound()
      Description copied from class: Plot
      Returns the upper bound of data.
      Specified by:
      getUpperBound in class Plot
      Returns:
      the upper bound of data.
    • paint

      public void paint(Renderer g)
      Description copied from class: Shape
      Draws the shape.
      Specified by:
      paint in class Shape
      Parameters:
      g - the renderer.
    • figure

      public Figure figure()
      Description copied from class: Plot
      Returns a figure containing the plot.
      Overrides:
      figure in class Plot
      Returns:
      a figure containing the plot.
    • of

      public static SparseMatrixPlot of(SparseMatrix matrix)
      Creates a sparse matrix plot with blue color for nonzero entries.
      Parameters:
      matrix - the sparse matrix.
      Returns:
      the plot.
    • of

      public static SparseMatrixPlot of(SparseMatrix matrix, int k)
      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.