Example usage for weka.gui.visualize PlotData2D setShapeType

List of usage examples for weka.gui.visualize PlotData2D setShapeType

Introduction

In this page you can find the example usage for weka.gui.visualize PlotData2D setShapeType.

Prototype

public void setShapeType(ArrayList<Integer> st) throws Exception 

Source Link

Document

Set the shape type for the plot data

Usage

From source file:milk.visualize.MIPlot2D.java

License:Open Source License

/**
 * Sets the plot vectors from a set of exemplars
 * @param added the exemplars//from w w w.  j ava2  s  . c o m
 * @exception exception Exception if plots could not be set
 */
public void setPlotExemplars(Exemplars added) throws Exception {
    super.removeAllPlots(); // Set xIndex, yIndex and cIndex to 0   
    if (added == null) {
        plotExemplars = null;
        setEnabled(false);
        return;
    }

    plotExemplars = new Exemplars(added);
    int cIndex = plotExemplars.classIndex();

    for (int i = 0; i < plotExemplars.numExemplars(); i++) {
        Exemplar ex = plotExemplars.exemplar(i);
        Instances insts = ex.getInstances();
        PlotData2D tmp = new PlotData2D(insts);
        int num = insts.numInstances();
        int[] shapes = new int[num];
        int[] sizes = new int[num];
        for (int j = 0; j < num; j++) {
            shapes[j] = Plot2D.X_SHAPE;
            sizes[j] = Plot2D.DEFAULT_SHAPE_SIZE;
        }

        tmp.setShapeType(shapes);
        tmp.setShapeSize(sizes);
        tmp.m_useCustomColour = false;
        tmp.setCindex(cIndex);
        tmp.setPlotName(Integer.toString((int) ex.idValue()));
        addPlot(tmp); // determineBound() involved
    }
    // Reset
    if (x != null)
        setXValue(x);
    if (y != null)
        setYValue(y);
    m_cIndex = cIndex;
    if (!Double.isNaN(maxC))
        m_maxC = maxC;
    if (!Double.isNaN(minC))
        m_minC = minC;
}