Class Surface


public class Surface extends Plot
A surface object gives 3D information e.g. a contour plots.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Surface(double[][][] data)
    Constructor for irregular mesh grid.
    Surface(double[][][] data, Color[] palette)
    Constructor for irregular mesh surface.
  • Method Summary

    Modifier and Type
    Method
    Description
    double[]
    Returns the lower bound of data.
    double[]
    Returns the upper bound of data.
    static Surface
    of(double[][] z, int k)
    Creates a regular mesh surface with the jet color palette.
    static Surface
    of(double[][] z, Color[] palette)
    Creates a regular mesh surface.
    static Surface
    of(double[] x, double[] y, double[][] z)
    Creates an irregular mesh grid.
    static Surface
    of(double[] x, double[] y, double[][] z, int k)
    Creates an irregular mesh surface with the jet color palette.
    static Surface
    of(double[] x, double[] y, double[][] z, Color[] palette)
    Creates an irregular mesh surface.
    void
    Draws the shape.

    Methods inherited from class smile.plot.swing.Plot

    canvas, legends, toolbar, tooltip

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Surface

      public Surface(double[][][] data)
      Constructor for irregular mesh grid.
      Parameters:
      data - an m x n x 3 array which are coordinates of m x n surface.
    • Surface

      public Surface(double[][][] data, Color[] palette)
      Constructor for irregular mesh surface.
      Parameters:
      data - an m x n x 3 array which are coordinates of m x n surface.
  • Method Details

    • getLowerBound

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

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

      public void paint(Graphics g)
      Description copied from class: Shape
      Draws the shape.
      Specified by:
      paint in class Shape
    • of

      public static Surface of(double[][] z, int k)
      Creates a regular mesh surface with the jet color palette.
      Parameters:
      z - the z-axis values of surface. The x-axis and y-axis location of surface will be set to 0.5, 1.5, 2.5, ...
      k - the number of colors in the palette.
    • of

      public static Surface of(double[][] z, Color[] palette)
      Creates a regular mesh surface.
      Parameters:
      z - the z-axis values of surface. The x-axis and y-axis location of surface will be set to 0.5, 1.5, 2.5, ...
      palette - the color palette.
    • of

      public static Surface of(double[] x, double[] y, double[][] z)
      Creates an irregular mesh grid.
      Parameters:
      x - the x-axis values of surface.
      y - the y-axis values of surface.
      z - the z-axis values of surface.
    • of

      public static Surface of(double[] x, double[] y, double[][] z, int k)
      Creates an irregular mesh surface with the jet color palette.
      Parameters:
      x - the x-axis values of surface.
      y - the y-axis values of surface.
      z - the z-axis values of surface.
    • of

      public static Surface of(double[] x, double[] y, double[][] z, Color[] palette)
      Creates an irregular mesh surface.
      Parameters:
      x - the x-axis values of surface.
      y - the y-axis values of surface.
      z - the z-axis values of surface.
      palette - the color palette.