• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java Plot2DPanel类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.math.plot.Plot2DPanel的典型用法代码示例。如果您正苦于以下问题:Java Plot2DPanel类的具体用法?Java Plot2DPanel怎么用?Java Plot2DPanel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Plot2DPanel类属于org.math.plot包,在下文中一共展示了Plot2DPanel类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: main

import org.math.plot.Plot2DPanel; //导入依赖的package包/类
public static void main(String[] args) {
    Plot2DPanel p = new Plot2DPanel();

    double[][] cloud = new double[100][2];
    for (int i = 0; i < cloud.length; i++) {
        cloud[i][0] = Math.random() + Math.random();
        cloud[i][1] = Math.random() + Math.random();
    }
    p.addCloudPlot("cloud", Color.RED, cloud, 5, 5);

    double[][] cloud2 = new double[100][2];
    for (int i = 0; i < cloud2.length; i++) {
        cloud2[i][0] = 2 + Math.random() + Math.random();
        cloud2[i][1] = 2 + Math.random() + Math.random();
    }
    p.addCloudPlot("cloud2", Color.RED, cloud2, 5, 5);

    p.setLegendOrientation(PlotPanel.SOUTH);
    new FrameView(p).setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
 
开发者ID:Cvarier,项目名称:2D-Elliptic-Mesh-Generator,代码行数:21,代码来源:CloudPlot2D.java


示例2: main

import org.math.plot.Plot2DPanel; //导入依赖的package包/类
public static void main(String[] args) {
	double[] sXYZ = null;

	Plot2DPanel p2 = new Plot2DPanel();
	for (int i = 0; i < 2; i++) {
		double[][] XYZ = new double[10][2];
		sXYZ = new double[10];
		for (int j = 0; j < XYZ.length; j++) {
			XYZ[j][0] = /*1 + */Math.random();
			XYZ[j][1] = /*100 * */Math.random();
			sXYZ[j] = /*100 * */Math.random();
		}

		p2.addScatterPlot("toto" + i, XYZ);
	}
	p2.getPlot(0).addGaussQuantiles(0, sXYZ);
	p2.getPlot(1).addGaussQuantiles(1, 0.1);

	new FrameView(p2).setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
 
开发者ID:Cvarier,项目名称:2D-Elliptic-Mesh-Generator,代码行数:21,代码来源:GaussianDensityLayerPlot.java


示例3: main

import org.math.plot.Plot2DPanel; //导入依赖的package包/类
public static void main(String[] args) {
	Plot2DPanel p2 = new Plot2DPanel();
	for (int i = 0; i < 2; i++) {
		double[][] XYZ = new double[10][2];
		for (int j = 0; j < XYZ.length; j++) {
			XYZ[j][0] = /*1 + */Math.random();
			XYZ[j][1] = /*100 * */10 * Math.random();
		}

		p2.addScatterPlot("toto" + i, XYZ);
	}
	p2.getPlot(0).addQuantiles(1, new double[] {/*-3,-2,*/-4, -2, -0.5, 0, 0.5, 2, 4 /*,2,3*/});
	p2.getPlot(1).addQuantiles(1, new double[] { -3, -2, -1, 0, 1, 2, 3 });
	//p2.getPlot(1).addLayer(new DensityLayerPlot(p2.getPlot(1), 1, new double[] { -.1, 0, .1 }));

	new FrameView(p2).setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
 
开发者ID:Cvarier,项目名称:2D-Elliptic-Mesh-Generator,代码行数:18,代码来源:DensityLayerPlot.java


示例4: toGraphicFile

import org.math.plot.Plot2DPanel; //导入依赖的package包/类
public void toGraphicFile( File f) throws IOException {
    Plot2DPanel p = ((Plot2DPanel)plot);
    //p.toGraphicFile(f);
    // otherwise toolbar appears
    p.plotToolBar.setVisible(false);

    Image image = p.createImage(p.getWidth(), p.getHeight());
    //Image image = p.createImage(2000, p.getHeight());
    //System.out.println(p.getWidth()+"  "+p.getHeight());
    p.paint(image.getGraphics());
    image = new ImageIcon(image).getImage();

    BufferedImage bufferedImage = new BufferedImage(image.getWidth(null), image.getHeight(null), BufferedImage.TYPE_INT_RGB);
    //BufferedImage bufferedImage = new BufferedImage(p.getWidth(), p.getHeight(), BufferedImage.TYPE_INT_RGB);
    Graphics g = bufferedImage.createGraphics();
    g.drawImage(image, 0, 0, Color.WHITE, null);
    g.dispose();

    // make it reappear
    p.plotToolBar.setVisible(true);

    try {
            ImageIO.write((RenderedImage) bufferedImage, "PNG", f);
    } catch (IllegalArgumentException ex) {
    }
}
 
开发者ID:amherag,项目名称:intuitionistic-fis,代码行数:27,代码来源:JMathPlotter.java


示例5: print

import org.math.plot.Plot2DPanel; //导入依赖的package包/类
/**
 * Print the graph of the turning function in a dialog.
 */
public void print() {
  double[] x = new double[2 * turningValues.size()];
  double[] y = new double[2 * turningValues.size()];
  double totalLength = 0.0;
  for (int i = 0; i < turningValues.size(); i++) {
    // plot first point of the segment
    x[2 * i] = totalLength;
    y[2 * i] = turningValues.get(i);
    // plot second point of the segment
    totalLength += segmentLengths.get(i);
    x[2 * i + 1] = totalLength;
    y[2 * i + 1] = turningValues.get(i);
  }
  // create your PlotPanel (you can use it as a JPanel)
  Plot2DPanel plot = new Plot2DPanel();

  // add a line plot to the PlotPanel
  plot.addLinePlot("turning function", x, y);
  // put the PlotPanel in a JFrame, as a JPanel
  JFrame frame = new JFrame("a plot panel");
  frame.setContentPane(plot);
  frame.setVisible(true);
}
 
开发者ID:IGNF,项目名称:geoxygene,代码行数:27,代码来源:PolygonTurningFunction.java


示例6: print

import org.math.plot.Plot2DPanel; //导入依赖的package包/类
/**
 * Print the graph of the turning function in a dialog.
 */
public void print() {
  double[] x = new double[segmentLengths.size()];
  double[] y = new double[segmentLengths.size()];
  for (int i = 0; i < segmentLengths.size(); i++) {
    // plot the vertex
    x[i] = segmentLengths.get(i);
    y[i] = radialDistances.get(i);
  }
  // create your PlotPanel (you can use it as a JPanel)
  Plot2DPanel plot = new Plot2DPanel();

  // add a line plot to the PlotPanel
  plot.addLinePlot("turning function", x, y);
  // put the PlotPanel in a JFrame, as a JPanel
  JFrame frame = new JFrame("a plot panel");
  frame.setContentPane(plot);
  frame.setVisible(true);
}
 
开发者ID:IGNF,项目名称:geoxygene,代码行数:22,代码来源:PolygonSignatureFunction.java


示例7: drawWaveForm

import org.math.plot.Plot2DPanel; //导入依赖的package包/类
/**
     * drawWaveForm
     * 
     * @param parent
     * @param signal
     * @param sampleRate
     * @throws IllegalArgumentException
     * @throws IOException 
     */
    public static void drawWaveForm(Window parent, double[] signal, int sampleRate) throws IllegalArgumentException, IOException {
        // create time vector
        double[] x = createTimeVector(signal, sampleRate);

        // plot
        Plot2DPanel plot = new Plot2DPanel();
//        plot.setLegendOrientation("EAST");
//        plot.addLegend("Nagranie");
        plot.addLinePlot("Nagranie", x, signal);
        plot.setAxisLabel(0, "Czas [s]");
        plot.setAxisLabel(1, "Amplituda");

        // frame
        JDialog window = new JDialog(parent, "Nagranie");
        window.setSize(600, 600);
        window.setContentPane(plot);
        window.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
        window.setLocationRelativeTo(parent);
        window.setVisible(true);
        
    }
 
开发者ID:andrzejtrzaska,项目名称:VoiceStressAnalysis,代码行数:31,代码来源:PlotUtil.java


示例8: drawFundamentalFrequencyVector

import org.math.plot.Plot2DPanel; //导入依赖的package包/类
/**
     * drawFundamentalFrequencyVector
     * 
     * @param parent
     * @param fundamentalFrequencyVector
     */
    public static void drawFundamentalFrequencyVector(Window parent, double[] fundamentalFrequencyVector) {
        double[] y = fundamentalFrequencyVector;
        double[] x = new double[y.length];

        // populate x axis values
        for (int i = 0; i < x.length; i++) {
            x[i] = i;
        }

        // plot
        Plot2DPanel plot = new Plot2DPanel();
//        plot.setLegendOrientation("EAST");
//        plot.addLegend("Ton Podstawowy");
        plot.addLinePlot("Ton Podstawowy", x, y);
        plot.setAxisLabel(0, "Nr okna");
        plot.setAxisLabel(1, "Częstotliwość [Hz]");

        // window
        JDialog window = new JDialog(parent, "Ton Podstawowy");
        window.setSize(600, 600);
        window.setContentPane(plot);
        window.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
        window.setLocationRelativeTo(parent);
        window.setVisible(true);
    }
 
开发者ID:andrzejtrzaska,项目名称:VoiceStressAnalysis,代码行数:32,代码来源:PlotUtil.java


示例9: update

import org.math.plot.Plot2DPanel; //导入依赖的package包/类
@Override
public void update() {
	if (getAxis(0)!= -1&& getAxis(1)!= -1) {
		getPlotPanel().removeAllPlots();
           int totalNumberOfColumns = countColumns();
		for (int currentVariable = 0; currentVariable < totalNumberOfColumns; currentVariable ++){
			if (getPlotColumn(currentVariable)) {
				DataTable table = getDataTable();
				synchronized (table) {
					Iterator iterator = table.iterator();
					int i = 0;
					double[][] data = new double[getDataTable().getNumberOfRows()][2];
					double[][] deviation = new double[getDataTable().getNumberOfRows()][2];
					while (iterator.hasNext()) {
						DataTableRow row = (DataTableRow) iterator.next();
						data[i][0] = row.getValue(getAxis(0));
						if (Double.isNaN(data[i][0]))
							data[i][0] = 0.0d;
						data[i][1] = row.getValue(getAxis(1));
						if (Double.isNaN(data[i][1]))
							data[i][1] = 0.0d;
						deviation[i][0] = deviation[i][1] = row.getValue(currentVariable);
						if (Double.isNaN(deviation[i][0]))
							deviation[i][0] = deviation[i][1] = 0.0d;
						i++;
					}
					// PlotPanel construction
                       Color color = getColorProvider().getPointColor((double)(currentVariable + 1) / (double)totalNumberOfColumns);
					((Plot2DPanel)getPlotPanel()).addBoxPlot(getDataTable().getColumnName(currentVariable), color, data, deviation);
				}
			}
		}
	}
}
 
开发者ID:rapidminer,项目名称:rapidminer-5,代码行数:35,代码来源:BoxPlot2D.java


示例10: update

import org.math.plot.Plot2DPanel; //导入依赖的package包/类
@Override
public void update() {
	if (getAxis(0) != -1) {
		getPlotPanel().removeAllPlots();
		int totalNumberOfColumns = countColumns();
		for (int currentVariable = 0; currentVariable < totalNumberOfColumns; currentVariable++) {
			if (getPlotColumn(currentVariable)) {
				DataTable table = getDataTable();
				synchronized (table) {
					Iterator iterator = table.iterator();
					int i = 0;
					double[][] data = new double[getDataTable().getNumberOfRows()][2];
					while (iterator.hasNext()) {
						DataTableRow row = (DataTableRow) iterator.next();
						data[i][0] = row.getValue(getAxis(0));
						if (Double.isNaN(data[i][0])) {
							data[i][0] = 0.0d;
						}
						data[i][1] = row.getValue(currentVariable);
						if (Double.isNaN(data[i][1])) {
							data[i][1] = 0.0d;
						}
						i++;
					}
					// PlotPanel construction
					Color color = getColorProvider().getPointColor(
							(double) (currentVariable + 1) / (double) totalNumberOfColumns);
					((Plot2DPanel) getPlotPanel())
							.addBarPlot(getDataTable().getColumnName(currentVariable), color, data);
				}
			}
		}
	} else {
		getPlotPanel().removeAllPlots();
	}
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:37,代码来源:SticksPlot2D.java


示例11: main

import org.math.plot.Plot2DPanel; //导入依赖的package包/类
public static void main(String[] args) {
	Plot2DPanel p2 = new Plot2DPanel();
	for (int i = 0; i < 1; i++) {
		double[][] XYZ = new double[10][2];
		for (int j = 0; j < XYZ.length; j++) {
			XYZ[j][0] = /*1 + */Math.random();
			XYZ[j][1] = /*100 * */Math.random();
		}
		p2.addScatterPlot("toto" + i, XYZ);
	}
	p2.addQuantiletoPlot(0, 1, 1.0, true, 0.2);
	new FrameView(p2).setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
 
开发者ID:Cvarier,项目名称:2D-Elliptic-Mesh-Generator,代码行数:14,代码来源:QuantileLayerPlot.java


示例12: update

import org.math.plot.Plot2DPanel; //导入依赖的package包/类
@Override
public void update() {
	if (getAxis(0) != -1) {
		getPlotPanel().removeAllPlots();
		int totalNumberOfColumns = countColumns();
		for (int currentVariable = 0; currentVariable < totalNumberOfColumns; currentVariable++) {
			if (getPlotColumn(currentVariable)) {
				DataTable table = getDataTable();
				synchronized (table) {
					int i = 0;
					double[][] data = new double[getDataTable().getNumberOfRows()][2];
					for (DataTableRow row : table) {
						data[i][0] = row.getValue(getAxis(0));
						if (Double.isNaN(data[i][0])) {
							data[i][0] = 0.0d;
						}
						data[i][1] = row.getValue(currentVariable);
						if (Double.isNaN(data[i][1])) {
							data[i][1] = 0.0d;
						}
						i++;
					}
					// PlotPanel construction
					Color color = getColorProvider().getPointColor(
							(double) (currentVariable + 1) / (double) totalNumberOfColumns);
					((Plot2DPanel) getPlotPanel())
							.addBarPlot(getDataTable().getColumnName(currentVariable), color, data);
				}
			}
		}
	} else {
		getPlotPanel().removeAllPlots();
	}
}
 
开发者ID:rapidminer,项目名称:rapidminer-studio,代码行数:35,代码来源:SticksPlot2D.java


示例13: update

import org.math.plot.Plot2DPanel; //导入依赖的package包/类
@Override
public void update() {
	if (getAxis(0) != -1 && getAxis(1) != -1) {
		getPlotPanel().removeAllPlots();
		int totalNumberOfColumns = countColumns();
		for (int currentVariable = 0; currentVariable < totalNumberOfColumns; currentVariable++) {
			if (getPlotColumn(currentVariable)) {
				DataTable table = getDataTable();
				synchronized (table) {
					int i = 0;
					double[][] data = new double[getDataTable().getNumberOfRows()][2];
					double[][] deviation = new double[getDataTable().getNumberOfRows()][2];
					for (DataTableRow row : table) {
						data[i][0] = row.getValue(getAxis(0));
						if (Double.isNaN(data[i][0])) {
							data[i][0] = 0.0d;
						}
						data[i][1] = row.getValue(getAxis(1));
						if (Double.isNaN(data[i][1])) {
							data[i][1] = 0.0d;
						}
						deviation[i][0] = deviation[i][1] = row.getValue(currentVariable);
						if (Double.isNaN(deviation[i][0])) {
							deviation[i][0] = deviation[i][1] = 0.0d;
						}
						i++;
					}
					// PlotPanel construction
					Color color = getColorProvider().getPointColor(
							(double) (currentVariable + 1) / (double) totalNumberOfColumns);
					((Plot2DPanel) getPlotPanel()).addBoxPlot(getDataTable().getColumnName(currentVariable), color,
							data, deviation);
				}
			}
		}
	} else {
		getPlotPanel().removeAllPlots();
	}
}
 
开发者ID:rapidminer,项目名称:rapidminer-studio,代码行数:40,代码来源:BoxPlot2D.java


示例14: plot2D

import org.math.plot.Plot2DPanel; //导入依赖的package包/类
/**
 * draws a 2D plot
 * @param xs x-coordiantes 
 * @param ys y-coordinates
 */
public static void plot2D(double [] xs, double [] ys) {
	JFrame frame = createFrame("Plot 2D");
	Plot2DPanel panel = new Plot2DPanel();
	panel.addLinePlot("plot", xs, ys);
	frame.getContentPane().add(panel);
	frame.setVisible(true);
}
 
开发者ID:akmaier,项目名称:CONRAD,代码行数:13,代码来源:PlotHelper.java


示例15: drawSpectrum

import org.math.plot.Plot2DPanel; //导入依赖的package包/类
/**
     * drawSpectrum
     * 
     * @param parent
     * @param signal
     * @param sampleRate
     * @throws IllegalArgumentException
     * @throws IOException 
     */
    public static void drawSpectrum(Window parent, double[] signal, int sampleRate) throws IllegalArgumentException, IOException {
        // calculate range
        int range = (int)(20000.0 * (double)signal.length / (double)sampleRate);

        // create x array
        double[] x = new double[(int)range];

        // populate x array
        for (int i = 0; i < x.length; i++) {
            x[i] = i * sampleRate / signal.length;
        }

        // calculate fft
        double[] fft = FFTUtil.fft_jtransforms(signal);

        // create spectrum array
        double[] spectrum = new double[range];

        // populate spectrum array
        for (int i = 0; i < spectrum.length; i++) {
            spectrum[i] = MathUtil.calcMagnitudeDB(fft[i*2], fft[i*2+1]);
        }

        // plot
        Plot2DPanel plot = new Plot2DPanel();
//        plot.setLegendOrientation("EAST");
//        plot.addLegend("Spectrum");
        plot.addLinePlot("Spectrum", x, spectrum);
        plot.setAxisLabel(0, "Frequency [Hz]");
        plot.setAxisLabel(1, "Natężenie");

        // window
        JDialog window = new JDialog(parent, "Spectrum");
        window.setSize(600, 600);
        window.setContentPane(plot);
        window.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
        window.setLocationRelativeTo(parent);
        window.setVisible(true);
    }
 
开发者ID:andrzejtrzaska,项目名称:VoiceStressAnalysis,代码行数:49,代码来源:PlotUtil.java


示例16: drawF0NormalDistribution

import org.math.plot.Plot2DPanel; //导入依赖的package包/类
/**
     * drawF0NormalDistribution
     * 
     * @param parent
     * @param instance 
     */
    public static void drawF0NormalDistribution(Window parent, VoiceStressInstance instance) {
        // create gaussian function
        Gaussian gaussian = new Gaussian(instance.getMean(), instance.getStd());

        // number of values
        int numValues = Config.plotNumValues;
        
        // create x array
        double[] x = new double[numValues];
        
        // calculate x values
        for(int i = 0; i < numValues; i++) {
            x[i] = (((double)i / (double)numValues) * Config.plotXMax);
        }

        // create y array
        double[] y = new double[numValues];

        // calculate y values
        for(int i = 0; i < y.length; i++) {
            y[i] = gaussian.value(x[i]);
        }

        // plot
        Plot2DPanel plot = new Plot2DPanel();
//        plot.setLegendOrientation("EAST");
//        plot.addLegend("Rozkład normanlny tonu fundamentalnego");
        plot.addLinePlot("Rozkład normanlny tonu fundamentalnego", x, y);
        plot.setAxisLabel(0, "Częstotliwość [Hz]");
        plot.setAxisLabel(1, "Rozkład");

        // window
        JDialog window = new JDialog(parent, "Ton Podstawowy");
        window.setSize(600, 600);
        window.setContentPane(plot);
        window.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
        window.setLocationRelativeTo(parent);
        window.setVisible(true);
    }
 
开发者ID:andrzejtrzaska,项目名称:VoiceStressAnalysis,代码行数:46,代码来源:PlotUtil.java


示例17: drawNormalDistribution

import org.math.plot.Plot2DPanel; //导入依赖的package包/类
/**
     * drawNormalDistribution
     * 
     * @param parent
     * @param mean
     * @param std
     */
    public static void drawNormalDistribution(Window parent, double mean, double std) {
        // create gaussian function
        Gaussian gaussian = new Gaussian(mean, std);

        // number of values
        int numValues = Config.plotNumValues;
        
        // create x array
        double[] x = new double[numValues];
        
        // calculate x values
        for(int i = 0; i < numValues; i++) {
            x[i] = (((double)i / (double)numValues) * Config.plotXMax);
        }

        // create y array
        double[] y = new double[numValues];

        // calculate y values
        for(int i = 0; i < y.length; i++) {
            y[i] = gaussian.value(x[i]);
        }

        // plot
        Plot2DPanel plot = new Plot2DPanel();
//        plot.setLegendOrientation("EAST");
//        plot.addLegend("Rozkład normanlny tonu fundamentalnego");
        plot.addLinePlot("Rozkład normanlny", x, y);
        plot.setAxisLabel(0, "Częstotliwość [Hz]");
        plot.setAxisLabel(1, "Rozkład");

        // window
        JDialog window = new JDialog(parent, "Rozkład normanlny");
        window.setSize(600, 600);
        window.setContentPane(plot);
        window.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
        window.setLocationRelativeTo(parent);
        window.setVisible(true);
    }
 
开发者ID:andrzejtrzaska,项目名称:VoiceStressAnalysis,代码行数:47,代码来源:PlotUtil.java


示例18: update

import org.math.plot.Plot2DPanel; //导入依赖的package包/类
@Override
public void update() {
	if (getAxis(0)!= -1) {
		getPlotPanel().removeAllPlots();
           int totalNumberOfColumns = countColumns();
		for (int currentVariable = 0; currentVariable < totalNumberOfColumns; currentVariable ++){
			if (getPlotColumn(currentVariable)) {
				DataTable table = getDataTable();
				synchronized (table) {
					Iterator iterator = table.iterator();
					int i = 0;
					double[][] data = new double[getDataTable().getNumberOfRows()][2];
					while (iterator.hasNext()) {
						DataTableRow row = (DataTableRow) iterator.next();
						data[i][0] = row.getValue(getAxis(0));
						if (Double.isNaN(data[i][0]))
							data[i][0] = 0.0d;
						data[i][1] = row.getValue(currentVariable);
						if (Double.isNaN(data[i][1]))
							data[i][1] = 0.0d;
						i++;
					}
					// PlotPanel construction
                       Color color = getColorProvider().getPointColor((double)(currentVariable + 1) / (double)totalNumberOfColumns);
					((Plot2DPanel)getPlotPanel()).addBarPlot(getDataTable().getColumnName(currentVariable), color, data);
				}
			}
		}
	}
}
 
开发者ID:rapidminer,项目名称:rapidminer-5,代码行数:31,代码来源:SticksPlot2D.java


示例19: createPlotPanel

import org.math.plot.Plot2DPanel; //导入依赖的package包/类
@Override
protected PlotPanel createPlotPanel() {
	return new Plot2DPanel();
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:5,代码来源:JMathPlotter2D.java


示例20: update

import org.math.plot.Plot2DPanel; //导入依赖的package包/类
@Override
public void update() {
	if (getAxis(0) != -1 && getAxis(1) != -1) {
		getPlotPanel().removeAllPlots();
		int totalNumberOfColumns = countColumns();
		for (int currentVariable = 0; currentVariable < totalNumberOfColumns; currentVariable++) {
			if (getPlotColumn(currentVariable)) {
				DataTable table = getDataTable();
				synchronized (table) {
					Iterator iterator = table.iterator();
					int i = 0;
					double[][] data = new double[getDataTable().getNumberOfRows()][2];
					double[][] deviation = new double[getDataTable().getNumberOfRows()][2];
					while (iterator.hasNext()) {
						DataTableRow row = (DataTableRow) iterator.next();
						data[i][0] = row.getValue(getAxis(0));
						if (Double.isNaN(data[i][0])) {
							data[i][0] = 0.0d;
						}
						data[i][1] = row.getValue(getAxis(1));
						if (Double.isNaN(data[i][1])) {
							data[i][1] = 0.0d;
						}
						deviation[i][0] = deviation[i][1] = row.getValue(currentVariable);
						if (Double.isNaN(deviation[i][0])) {
							deviation[i][0] = deviation[i][1] = 0.0d;
						}
						i++;
					}
					// PlotPanel construction
					Color color = getColorProvider().getPointColor(
							(double) (currentVariable + 1) / (double) totalNumberOfColumns);
					((Plot2DPanel) getPlotPanel()).addBoxPlot(getDataTable().getColumnName(currentVariable), color,
							data, deviation);
				}
			}
		}
	} else {
		getPlotPanel().removeAllPlots();
	}
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:42,代码来源:BoxPlot2D.java



注:本文中的org.math.plot.Plot2DPanel类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java CyNetworkViewFactory类代码示例发布时间:2022-05-22
下一篇:
Java MapAttemptFinished类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap