Examples of PSpage


Examples of com.nr.lna.PSpage

   

    // Test PSpage
    System.out.println("Testing PSpage");
   
    PSpage pg=new PSpage(new java.io.File("PSpage_output.ps"));
    pg.puttext("Hello",100,100,0.0);
//    pg.addtext(" World");
    pg.putctext("Hello World",200,100,0.0);
    pg.putrtext("Hello World",300,100,0.0);
    pg.lineseg(400,100,500,100);
    pg.pointsymbol(550,100,72,16.0);

    pg.setlinewidth(3.0);
    pg.setdash("4 4");
    pg.puttext("Hello",100,200,90.0);
//    pg.addtext(" World");
    pg.putctext("Hello World",200,200,90.0);
    pg.putrtext("Hello World",300,200,90.0);
    pg.lineseg(400,200,500,200);
    pg.pointsymbol(550,200,108,20.0);

    pg.setdash("");
    pg.puttext("Hello",100,300,45.0);
//    pg.addtext(" World");
    pg.putctext("Hello World",200,300,45.0);
    pg.putrtext("Hello World",300,300,45.0);
    pg.lineseg(400,300,500,300);
    pg.pointsymbol(550,300,115,20.0);

    pg.gsave();
    pg.setgray(0.7);
    pg.puttext("Hello",100,400,45.0);
//    pg.addtext(" World");
    pg.putctext("Hello World",200,400,45.0);
    pg.putrtext("Hello World",300,400,45.0);
    pg.lineseg(400,400,500,400);
    pg.pointsymbol(550,400,110,20.0);

    pg.grestore();
    pg.puttext("Hello",100,500,45.0);
//    pg.addtext(" World");
    pg.putctext("Hello World",200,500,45.0);
    pg.putrtext("Hello World",300,500,45.0);
    pg.lineseg(400,500,500,500);
    pg.pointsymbol(550,500,112,12.0);

    pg.puttext("Hello",100,600,45.0);
    pg.rawps("gsave 200.0 600.0 translate 90.0 rotate 0 0 mt ");
    pg.addtext(" World");
    pg.rawps("grestore\n");

    double xx[]={300.0,350.0,400.0,350.0,300.0};
    double yy[]={650.0,650.0,600.0,550.0,550.0};
    double[] x=buildVector(xx),y=buildVector(yy);
    pg.polyline(x,y,true,false,false);

    pg.setcolor(255,0,0);
    double xx2[]={450.0,500.0,550.0,500.0,450.0};
    double yy2[]={650.0,650.0,600.0,550.0,550.0};
    double[] x2=buildVector(xx2),y2=buildVector(yy2);
    pg.polyline(x2,y2,true,true,false);

    pg.close();
    // pg.display();

    if (globalflag) System.out.println("Failed\n");
    else System.out.println("Passed\n");
  }
View Full Code Here

Examples of com.nr.lna.PSpage

      y3[i] = exp(-0.5*sqrt(5.-x1[i]));
      x2[i] = cos(0.062957*i);
      y4[i] = sin(0.088141*i);
    }

    PSpage pg=new PSpage(new java.io.File("PSplot_output.ps"));
    PSplot plot1=new PSplot(pg,100.,500.,100.,500.);

    plot1.setlimits(0.,5.,0.,1.);
    plot1.frame();
    plot1.autoscales();
    plot1.xlabel("abscissa");
    plot1.ylabel("ordinate");
    plot1.lineplot(x1,y1);
    plot1.setdash("2 4");
    plot1.lineplot(x1,y2);
    plot1.setdash("6 2 4 2");
    plot1.lineplot(x1,y3);
    plot1.setdash("");

    plot1.pointsymbol(1.,exp(-0.5),72,16.);
    plot1.pointsymbol(2.,exp(-1.),108,12.);
    plot1.pointsymbol(2.,exp(-2.),115,12.);
    plot1.label("dingbat 72",1.1,exp(-0.5));
    plot1.label("dingbat 108",2.1,exp(-1.));
    plot1.label("dingbat 115",2.1,exp(-2.));
   
    PSplot plot2=new PSplot(pg,325.,475.,325.,475.);
    plot2.clear();
    plot2.setlimits(-1.2,1.2,-1.2,1.2);
    plot2.frame();
    plot2.scales(1.,0.5,1.,0.5);
    plot2.lineplot(x2,y4);

    pg.close();
    // pg.display();

    if (globalflag) System.out.println("Failed\n");
    else System.out.println("Passed\n");
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.