Package scalaSci.math.plot

Examples of scalaSci.math.plot.Plot3DPanel


  /*
   * MAIN METHOD(for testing)
   */

  public static void main(String[] args) {
    Plot3DPanel p = new Plot3DPanel();
    Object[][] XYZ = new Object[8][3];
    Object[][] XYZ2 = new Object[10][3];

    for (int j = 0; j < XYZ.length; j++) {
      XYZ[j][0] = Math.random();
      XYZ[j][1] = Math.random();
      XYZ[j][2] = "" + ((char) ('a' + j));
    }

    for (int j = 0; j < XYZ2.length; j++) {
      XYZ2[j][0] = Math.random();
      XYZ2[j][1] = Math.random();
      XYZ2[j][2] = "" + ((char) ('a' + j));
    }

    p.addScatterPlot("toto", p.mapData(XYZ));
    p.addScatterPlot("toti", p.mapData(XYZ2));
    p.setAxisScale(1, "log");
                p.setAxisLabel(0, "Axis 0");
                p.setAxisLabels("sterg X", "sterg Y", "sterg Z");

    new FrameView(p).setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    HashMap<String, Double> arg = p.getAxis(2).getStringMap();
    Collection<Double> ouch = arg.values();
    Iterator<Double> it = ouch.iterator();
    while (it.hasNext()) {
      System.out.println(it.next());
    }
View Full Code Here


    return null;
  }

    
public static void main(String[] args) {
    Plot3DPanel p = new Plot3DPanel();

    //triangular random cloud (as sum of two uniform random numbers)
    double[][] cloud = new double[1000][3];
    for (int i = 0; i < cloud.length; i++) {
      cloud[i][0] = Math.random() + Math.random();
      cloud[i][1] = Math.random() + Math.random();
      cloud[i][2] = Math.random() + Math.random();
    }
    p.addCloudPlot("cloud", Color.RED, cloud, 3, 3, 3);

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

    p.setLegendOrientation(PlotPanel.SOUTH);
    new FrameView(p).setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
  }
View Full Code Here

TOP

Related Classes of scalaSci.math.plot.Plot3DPanel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.