/** Example to show use of SimplePlot class * Simon George, 1 Oct 2001. */ public class SimplePlotTest { public static void testHistogram() { // some arbitrary data to use for bin heights double[] binData = { 1, 3, 17, 21, 33, 14, 3, 2, 5, 9, 2, 0 }; SimplePlot p = new SimplePlot(); p.setTitle("Example Histogram"); p.setXLabel("x"); p.setYLabel("count"); p.drawHistogram("my data", 0, 24, binData); } public static void testCurve() { // calculate some points to plot using method f defined below // put them in arrays x & y double xMin = 0.0; double xMax = 3.0; double[] x = new double[30]; double[] y = new double[x.length]; for (int i=0; i scatter plot p.setMarksStyle("various"); // can be: none, points, dots, various p.drawCurve("sin(x)", x, y); // first set of points p.drawCurve("cos(x)", x, z); // second set, will be shown in a different colour } public static double f(double x){ final double tau = 2.0; return Math.exp(-x/tau); } public static void main(String[] args) { testHistogram(); testCurve(); testScatter(); } }