PlotPanel plot = new PlotPanel(1,1);
private PoleZeroPlot() { _plotPanel = new PlotPanel(); _plotPanel.setTitle("poles and zeros"); _plotPanel.setHLabel("real");
public static void main(String args[]) { System.out.println("LogAxisPlotDemo2"); int n = 1000; float X = 300; float[] x = ArrayMath.rampfloat(0.0f,X / n,n); float[] f = new float[n]; for (int i = 0; i < n; ++i) { f[i] = pow(1.5f * x[i],2); } // new plot PlotPanel plot = new PlotPanel(2,2); pv1 = plot.addPoints(0,0,x,f); pv2 = plot.addPoints(0,1,x,f); pv3 = plot.addPoints(1,0,x,f); pv4 = plot.addPoints(1,1,x,f); // frame setup plot.setVisible(true); PlotFrame frame = new PlotFrame(plot); frame.setSize(800,500); frame.add(makeScaleOptionPanel(),BorderLayout.EAST); frame.setDefaultCloseOperation(PlotFrame.EXIT_ON_CLOSE); frame.setVisible(true); }
private static void plot(TriMesh tm) { TriMeshView tmv = new TriMeshView(tm); tmv.setPolysVisible(true); tmv.setTriColor(Color.BLACK); tmv.setPolyColor(Color.BLUE); PlotPanel panel = new PlotPanel(); panel.setHLabel("x"); panel.setVLabel("y"); Mosaic mosaic = panel.getMosaic(); mosaic.getTile(0,0).addTiledView(tmv); PlotFrame frame = new PlotFrame(panel); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setSize(700,700); frame.setVisible(true); } }
private static void demo1() { int n = 50; float[] x1 = randfloat(n); float[] x2 = randfloat(n); float[] x3 = randfloat(n); PlotPanel panel = new PlotPanel(1,1); panel.setLimits(-0.1,-0.1,1.1,1.1); PointsView pv = panel.addPoints(x1,x2,x3); pv.setLineStyle(PointsView.Line.NONE); pv.setMarkStyle(PointsView.Mark.FILLED_CIRCLE); pv.setTextFormat("%4.2f"); PlotFrame frame = new PlotFrame(panel); frame.setSize(800,800); frame.setDefaultCloseOperation(PlotFrame.EXIT_ON_CLOSE); frame.setVisible(true); //frame.paintToPng(300,6,"junk.png"); } }
private static void go() { int nx = 101; float dx = 0.1f; float fx = -0.5f*dx*(float)(nx-1); Sampling sx = new Sampling(nx,dx,fx); float[] f1 = rampfloat(fx,dx,nx); float[] f2 = add(0.5f,sin(f1)); PlotPanel panel = new PlotPanel(2,1); SequenceView sv1 = panel.addSequence(0,0,sx,f1); sv1.setColor(Color.RED); SequenceView sv2 = panel.addSequence(1,0,sx,f2); sv2.setZero(SequenceView.Zero.MIDDLE); PlotFrame frame = new PlotFrame(panel); frame.setDefaultCloseOperation(PlotFrame.EXIT_ON_CLOSE); frame.setSize(950,500); frame.setVisible(true); frame.paintToPng(300,6,"junk.png"); } }
public PlotFrameDemo() { float[] x = rampfloat(0.0f,4.0f*FLT_PI/200.0f,201); float[] s = sin(x); _plotPanel = new PlotPanel(); _plotPanel.setTitle("The sine function"); _plotPanel.setHLabel("x"); _plotPanel.setVLabel("sin(x)"); _gridView = _plotPanel.addGrid(); _pointsView = _plotPanel.addPoints(x,s); _pointsView.setStyle("r-o"); _plotFrame = new PlotFrame(_plotPanel); _plotFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); _plotFrame.setVisible(true); _plotFrame.add( new Label("In either plot or axes, click-drag to zoom, click to unzoom."), BorderLayout.NORTH); }
Sampling s2 = new Sampling(n2,0.5,0.25*(n2-1)); PlotPanel panel = new PlotPanel(1,2); PixelsView pv0 = panel.addPixels(0,0,f); pv0.setInterpolation(PixelsView.Interpolation.NEAREST);
Sampling s2 = new Sampling(n2,0.5,0.25*(n2-1)); PlotPanel panel = new PlotPanel(1,2); PixelsView pv0 = panel.addPixels(0,0,new float[][][]{f0,f1,f2}); pv0.setInterpolation(PixelsView.Interpolation.NEAREST);
PlotPanel panel = new PlotPanel(1,2,orientation);