weka.gui.visualize

## Class PlotData2D

- java.lang.Object
- - weka.gui.visualize.PlotData2D

- All Implemented Interfaces:
    java.io.Serializable

      public class PlotData2D
      extends java.lang.Object
      implements java.io.Serializable

  This class is a container for plottable data. Instances form the primary data. An optional array of classifier/clusterer predictions (associated 1 for 1 with the instances) can also be provided.
  Version:
    $Revision: 10220 $
  Author:
    Mark Hall (mhall@cs.waikato.ac.nz)
  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `int` | `m_alwaysDisplayPointsOfThisSize` If the shape size of a point equals this size then always plot it (i.e.
    `java.awt.Color` | `m_customColour`
    `boolean` | `m_displayAllPoints` Display all points (ie.
    `boolean` | `m_useCustomColour` Custom colour for this plot

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `PlotData2D(Instances insts)` Construct a new PlotData2D using the supplied instances

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addInstanceNumberAttribute()` Adds an instance number attribute to the plottable instances,
    `int` | `getCindex()` Get the currently set colouring index of the data
    `Instances` | `getPlotInstances()` Returns the instances for this plot
    `java.lang.String` | `getPlotName()` Get the name of this plot
    `java.lang.String` | `getPlotNameHTML()` Get the name of the plot for use in a tool tip text.
    `int[]` | `getShapeSize()` Get the shape sizes for the plot data
    `int[]` | `getShapeType()` Get the shape types for the plot data
    `int` | `getXindex()` Get the currently set x index of the data
    `int` | `getYindex()` Get the currently set y index of the data
    `void` | `setCindex(int c)` Set the colouring index of the data
    `void` | `setConnectPoints(java.util.ArrayList<java.lang.Boolean> cp)` Set whether consecutive points should be connected by lines
    `void` | `setConnectPoints(boolean[] cp)` Set whether consecutive points should be connected by lines
    `void` | `setCustomColour(java.awt.Color c)` Set a custom colour to use for this plot.
    `void` | `setPlotName(java.lang.String name)` Set the name of this plot
    `void` | `setPlotNameHTML(java.lang.String name)` Set the plot name for use in a tool tip text.
    `void` | `setShapeSize(java.util.ArrayList<java.lang.Object> ss)` Set the shape sizes for the plot data
    `void` | `setShapeSize(int[] ss)` Set the shape sizes for the plot data
    `void` | `setShapeType(java.util.ArrayList<java.lang.Integer> st)` Set the shape type for the plot data
    `void` | `setShapeType(int[] st)` Set the shape type for the plot data
    `void` | `setXindex(int x)` Set the x index of the data.
    `void` | `setYindex(int y)` Set the y index of the data

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### m_useCustomColour

          public boolean m_useCustomColour

      Custom colour for this plot

    - #### m_customColour

          public java.awt.Color m_customColour

    - #### m_displayAllPoints

          public boolean m_displayAllPoints

      Display all points (ie. those that map to the same display coords)

    - #### m_alwaysDisplayPointsOfThisSize

          public int m_alwaysDisplayPointsOfThisSize

      If the shape size of a point equals this size then always plot it (i.e. even if it is obscured by other points)

  - ### Constructor Detail

    - #### PlotData2D

          public PlotData2D(Instances insts)

      Construct a new PlotData2D using the supplied instances
      Parameters:
        `insts` - the instances to use.

  - ### Method Detail

    - #### addInstanceNumberAttribute

          public void addInstanceNumberAttribute()

      Adds an instance number attribute to the plottable instances,

    - #### getPlotInstances

          public Instances getPlotInstances()

      Returns the instances for this plot
      Returns:
        the instances for this plot

    - #### setPlotName

          public void setPlotName(java.lang.String name)

      Set the name of this plot
      Parameters:
        `name` - the name for this plot

    - #### getPlotName

          public java.lang.String getPlotName()

      Get the name of this plot
      Returns:
        the name of this plot

    - #### setPlotNameHTML

          public void setPlotNameHTML(java.lang.String name)

      Set the plot name for use in a tool tip text.
      Parameters:
        `name` - the name of the plot for potential use in a tool tip text (may use html).

    - #### getPlotNameHTML

          public java.lang.String getPlotNameHTML()

      Get the name of the plot for use in a tool tip text. Defaults to the standard plot name if it hasn't been set.
      Returns:
        the name of this plot (possibly in html) for use in a tool tip text.

    - #### setShapeType

          public void setShapeType(int[] st)
                            throws java.lang.Exception

      Set the shape type for the plot data
      Parameters:
        `st` - an array of integers corresponding to shape types (see constants defined in Plot2D)
      Throws:
        `java.lang.Exception`

    - #### getShapeType

          public int[] getShapeType()

      Get the shape types for the plot data
      Returns:
        the shape types for the plot data

    - #### setShapeType

          public void setShapeType(java.util.ArrayList<java.lang.Integer> st)
                            throws java.lang.Exception

      Set the shape type for the plot data
      Parameters:
        `st` - a FastVector of integers corresponding to shape types (see constants defined in Plot2D)
      Throws:
        `java.lang.Exception`

    - #### setShapeSize

          public void setShapeSize(int[] ss)
                            throws java.lang.Exception

      Set the shape sizes for the plot data
      Parameters:
        `ss` - an array of integers specifying the size of data points
      Throws:
        `java.lang.Exception`

    - #### getShapeSize

          public int[] getShapeSize()

      Get the shape sizes for the plot data
      Returns:
        the shape sizes for the plot data

    - #### setShapeSize

          public void setShapeSize(java.util.ArrayList<java.lang.Object> ss)
                            throws java.lang.Exception

      Set the shape sizes for the plot data
      Parameters:
        `ss` - a FastVector of integers specifying the size of data points
      Throws:
        `java.lang.Exception`

    - #### setConnectPoints

          public void setConnectPoints(boolean[] cp)
                                throws java.lang.Exception

      Set whether consecutive points should be connected by lines
      Parameters:
        `cp` - an array of boolean specifying which points should be connected to their preceeding neighbour.
      Throws:
        `java.lang.Exception`

    - #### setConnectPoints

          public void setConnectPoints(java.util.ArrayList<java.lang.Boolean> cp)
                                throws java.lang.Exception

      Set whether consecutive points should be connected by lines
      Parameters:
        `cp` - a FastVector of boolean specifying which points should be connected to their preceeding neighbour.
      Throws:
        `java.lang.Exception`

    - #### setCustomColour

          public void setCustomColour(java.awt.Color c)

      Set a custom colour to use for this plot. This overides any data index to use for colouring. If null, then will revert back to the default (no custom colouring).
      Parameters:
        `c` - a custom colour to use for this plot or null (default---no colouring).

    - #### setXindex

          public void setXindex(int x)

      Set the x index of the data.
      Parameters:
        `x` - the x index

    - #### setYindex

          public void setYindex(int y)

      Set the y index of the data
      Parameters:
        `y` - the y index

    - #### setCindex

          public void setCindex(int c)

      Set the colouring index of the data
      Parameters:
        `c` - the colouring index

    - #### getXindex

          public int getXindex()

      Get the currently set x index of the data
      Returns:
        the current x index

    - #### getYindex

          public int getYindex()

      Get the currently set y index of the data
      Returns:
        the current y index

    - #### getCindex

          public int getCindex()

      Get the currently set colouring index of the data
      Returns:
        the current colouring index