Package draw

Class Plot3D

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class Plot3D extends JPanel
Class for a panel for a 3D scatter plot.
Since:
2004.06.02
See Also:
  • Constructor Details

    • Plot3D

      public Plot3D()
      Create a panel for a 3D scatter plot.
      Since:
      2004.06.02 (Christian Borgelt)
  • Method Details

    • resetView

      public void resetView()
      Reset the view of the panel.
      Since:
      2004.06.02 (Christian Borgelt)
    • setFOV

      public void setFOV(double angle)
      Set the field of view (viewing angle) of the panel.
      Parameters:
      angle - the field of view (viewing angle)
      Since:
      2004.06.02 (Christian Borgelt)
    • setLayout

      public void setLayout(double offset, double size)
      Set the layout parameters for the labels.
      Parameters:
      offset - the offset from the cube sides
      size - the size of the font
      Since:
      2004.06.02 (Christian Borgelt)
    • setXLabel

      public void setXLabel(String label)
      Set the label for the x-axis.
      Parameters:
      label - the label for the x-axis
      Since:
      2004.06.03 (Christian Borgelt)
    • setYLabel

      public void setYLabel(String label)
      Set the label for the y-axis.
      Parameters:
      label - the label for the y-axis
      Since:
      2004.06.03 (Christian Borgelt)
    • setZLabel

      public void setZLabel(String label)
      Set the label for the z-axis.
      Parameters:
      label - the label for the z-axis
      Since:
      2004.06.03 (Christian Borgelt)
    • setInset

      public void setInset(double inset)
      Set the inset percentage (for all axes).
      Parameters:
      inset - the insert percentage
      Since:
      2014.01.27 (Christian Borgelt)
    • setMarker

      public void setMarker(int size)
      Set the size of the markers.
      Parameters:
      size - the size of the markers (in pixels)
      Since:
      2004.06.02 (Christian Borgelt)
    • clear

      public void clear()
      Remove all stored points.
      Since:
      2004.06.02 (Christian Borgelt)
    • removeAllPoints

      public void removeAllPoints()
      Remove all stored points.
      Since:
      2004.06.02 (Christian Borgelt)
    • addPoint

      public int addPoint(double x, double y, double z, int c)
      Add a colored point.
      Parameters:
      x - the x-coordinate of the point
      y - the y-coordinate of the point
      z - the z-coordinate of the point
      c - the color of the point
      Returns:
      the index of the added point
      Since:
      2004.06.02 (Christian Borgelt)
    • build

      public void build()
      Build the scatter plot.
      Since:
      2004.06.05 (Christian Borgelt)
    • build

      public void build(boolean rainbow)
      Build the scatter plot.
      Parameters:
      rainbow - whe
      Since:
      2013.12.29 (Christian Borgelt)
    • setColor

      public void setColor(int index, Color color)
      Set a color for an overlay value.

      Colors can be set only after the scatter plot has been built.

      Parameters:
      index - the index of the color to set
      color - the color to set
      Since:
      2004.06.02 (Christian Borgelt)
    • paint

      public void paint(Graphics g)
      (Re)paint the 3D scatter plot panel.
      Overrides:
      paint in class JComponent
      Parameters:
      g - the graphics to use for the painting
      Since:
      2004.06.02 (Christian Borgelt)
    • makeImage

      public BufferedImage makeImage()
      Create an image of the panel contents.
      Returns:
      an image of the panel contents
      Since:
      2007.02.07 (Christian Borgelt)