package javaapplication10; /** * This class plots the specified X,Y data on a scatter plot * An external window is created in which the plot can be zoomed, * printed, etc. * * This class uses the Jfree Chart library which is available for * public use under the GNU Lesser Public License * * @author Ajay Surie * 03-510 */ import java.awt.GradientPaint; import java.awt.Color; import org.jfree.chart.ChartFactory; import org.jfree.chart.ChartPanel; import org.jfree.chart.JFreeChart; import org.jfree.chart.axis.NumberAxis; import org.jfree.chart.plot.PlotOrientation; import org.jfree.chart.plot.XYPlot; import org.jfree.data.xy.XYDataset; import org.jfree.chart.renderer.xy.StandardXYItemRenderer; import org.jfree.chart.renderer.xy.XYDotRenderer; import org.jfree.data.xy.XYSeries; import org.jfree.data.xy.XYSeriesCollection; import org.jfree.ui.ApplicationFrame; import org.jfree.ui.RefineryUtilities; import java.util.*; public class Plotter extends ApplicationFrame { private JFreeChart myChart = null; /** * Constructs a new Plotter based on the specified parameters * @param title the frame title. * @param seriesName the name of the series to be plotted * @param xName the name of the x data * @param yName the name of the y data * @param x the x coordinates to be plotted * @param y the y coordinates to be plotted */ public Plotter(ArrayList x1, ArrayList y1) { super("Polynomial regression by xxx"); XYSeries series = new XYSeries("seriesName"); for(Double d : x1){ series.add(d,2.0); } // for(int i=0;i