Skip to content

Instantly share code, notes, and snippets.

@digorithm
Created January 9, 2015 00:04
Show Gist options
  • Save digorithm/47873ced1f8a4f872a00 to your computer and use it in GitHub Desktop.
Save digorithm/47873ced1f8a4f872a00 to your computer and use it in GitHub Desktop.
import javax.swing.JFrame;
import org.math.plot.*;
public class InitialData{
public static double[] x = {2, 4, 6, 8};
public static double[] y = {2, 5, 5, 8};
public void plotData(){
Plot2DPanel plot = new Plot2DPanel();
plot.addScatterPlot("X-Y", this.x, this.y);
JFrame frame = new JFrame("Original X-Y Data");
frame.setContentPane(plot);
frame.setSize(600, 600);
frame.setVisible(true);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment