Menu

Setting View 3DPlot

Fringel
2007-10-11
2013-03-22
  • Fringel

    Fringel - 2007-10-11

    Hello,

    does anybody know how to set manually the view (XY, XZ, etc.) in the 3DPlotPanel??

     
    • Nobody/Anonymous

      Hi,

      you have to call the setView method of projection:

      Plot3DPanel p = new Plot3DPanel();
              for (int i = 0; i < 3; i++) {
                  double[][] XYZ = new double[10][3];
                  for (int j = 0; j < XYZ.length; j++) {
                      XYZ[j][0] = /*1 +*/Math.random();
                      XYZ[j][1] = /*100 **/Math.random();
                      XYZ[j][2] = /*0.0001 **/Math.random();
                  }
                  p.addScatterPlot("toto" + i, XYZ);
              }

              p.setLegendOrientation(PlotPanel.SOUTH);
                      ((Projection3D)p.plotCanvas.draw.projection).setView(theta, phi);
              new FrameView(p).setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

      but for now it's impossible because plotCanvas.draw.projection is not public access.
      So you have to change it (maybe better with get/set).

      Yann

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.