Improved the plot function: it is now easier to change the plot from linear to logarithmic scale and the other way arround.

This commit is contained in:
Andreas Dräger 2010-04-12 08:11:46 +00:00
parent 82686fd280
commit a804380fe0
2 changed files with 191 additions and 131 deletions

View File

@ -296,7 +296,11 @@ public class FunctionArea extends DArea implements Serializable {
updateLegend(); updateLegend();
} }
protected boolean checkLoggable() { /**
*
* @return
*/
public boolean checkLoggable() {
double minY = Double.MAX_VALUE; double minY = Double.MAX_VALUE;
for (int i = 0; i < m_PointSetContainer.size(); i++) { for (int i = 0; i < m_PointSetContainer.size(); i++) {
DPointSet pSet = (m_PointSetContainer.get(i).getConnectedPointSet()); DPointSet pSet = (m_PointSetContainer.get(i).getConnectedPointSet());
@ -522,7 +526,7 @@ public class FunctionArea extends DArea implements Serializable {
} }
} }
if (maxSize > 0) { // if there is any data, init string array and set x if (maxSize > 0) { // if there is any data, init string array and set x
// value column // value column
s = new String[maxSize + 1]; s = new String[maxSize + 1];
s[0] = "calls"; s[0] = "calls";
for (int j = 1; j <= maxSize; j++) for (int j = 1; j <= maxSize; j++)
@ -536,11 +540,11 @@ public class FunctionArea extends DArea implements Serializable {
GraphPointSet set = (GraphPointSet) m_PointSetContainer.get(i); GraphPointSet set = (GraphPointSet) m_PointSetContainer.get(i);
DPointSet pset = set.getConnectedPointSet(); DPointSet pset = set.getConnectedPointSet();
s[0] = s[0] + " " + cleanBlanks(set.getInfoString(), '_'); // add s[0] = s[0] + " " + cleanBlanks(set.getInfoString(), '_'); // add
// column // column
// name // name
for (int j = 1; j < s.length; j++) { // add column data of place for (int j = 1; j < s.length; j++) { // add column data of place
// holder if no value in // holder if no value in
// this set // this set
if ((j - 1) < pset.getSize()) if ((j - 1) < pset.getSize())
s[j] = s[j] + " " + pset.getDPoint(j - 1).y; s[j] = s[j] + " " + pset.getDPoint(j - 1).y;
else else
@ -748,7 +752,7 @@ public class FunctionArea extends DArea implements Serializable {
if (legendBox != null && (m_legend)) if (legendBox != null && (m_legend))
legendBox.paintIn(g, m_Border.getInnerRect(this)); legendBox.paintIn(g, m_Border.getInnerRect(this));
} }
/** /**
* *
*/ */
@ -968,13 +972,25 @@ public class FunctionArea extends DArea implements Serializable {
ScaledBorder buffer = m_Border; ScaledBorder buffer = m_Border;
m_Border = new ScaledBorder(); m_Border = new ScaledBorder();
m_Border.x_label = buffer.x_label; // "App. " + Name + m_Border.x_label = buffer.x_label; // "App. " + Name +
// " func. calls"; // " func. calls";
m_Border.y_label = buffer.y_label; // "fitness"; m_Border.y_label = buffer.y_label; // "fitness";
setBorder(m_Border); setBorder(m_Border);
} }
repaint(); repaint();
} }
/**
* Allows setting whether or not to paint the y-axis in logarithmic scale.
*
* @param log
* if true logarithmic scale is used, linear scale in case of
* false.
*/
public void toggleLog(boolean log) {
if (log != m_log)
toggleLog();
}
/** /**
* Recreate the legend object with the current point sets. * Recreate the legend object with the current point sets.
* *

View File

@ -1,4 +1,5 @@
package eva2.gui; package eva2.gui;
/* /*
* Title: EvA2 * Title: EvA2
* Description: * Description:
@ -45,6 +46,7 @@ import eva2.server.go.individuals.AbstractEAIndividual;
import eva2.server.go.populations.Population; import eva2.server.go.populations.Population;
import eva2.tools.BasicResourceLoader; import eva2.tools.BasicResourceLoader;
import eva2.tools.chart2d.DPointSet; import eva2.tools.chart2d.DPointSet;
/*==========================================================================* /*==========================================================================*
* CLASS DECLARATION * CLASS DECLARATION
*==========================================================================*/ *==========================================================================*/
@ -53,6 +55,10 @@ import eva2.tools.chart2d.DPointSet;
*/ */
public class Plot implements PlotInterface, Serializable { public class Plot implements PlotInterface, Serializable {
/**
* Generated serial version identifier.
*/
private static final long serialVersionUID = -9027101244918249825L;
public static boolean TRACE = false; public static boolean TRACE = false;
private JFileChooser m_FileChooser; private JFileChooser m_FileChooser;
private JPanel m_ButtonPanel; private JPanel m_ButtonPanel;
@ -63,36 +69,43 @@ public class Plot implements PlotInterface, Serializable {
protected JFrame m_Frame; protected JFrame m_Frame;
/** /**
* You might want to try to assign the x-range as x and y-range as y array parameters. * You might want to try to assign the x-range as x and y-range as y array
* parameters.
*/ */
public Plot(String PlotName,String xname,String yname,double[] x,double[] y) { public Plot(String PlotName, String xname, String yname, double[] x,
if (TRACE) System.out.println("Constructor Plot "+PlotName); double[] y) {
if (TRACE)
System.out.println("Constructor Plot " + PlotName);
m_xname = xname; m_xname = xname;
m_yname = yname; m_yname = yname;
m_PlotName = PlotName; m_PlotName = PlotName;
init(); init();
DPointSet points = new DPointSet(); DPointSet points = new DPointSet();
for (int i=0;i<x.length;i++) { for (int i = 0; i < x.length; i++) {
points.addDPoint(x[i],y[i]); points.addDPoint(x[i], y[i]);
} }
m_PlotArea.addDElement(points); m_PlotArea.addDElement(points);
} }
/** /**
* *
*/ */
public Plot(String PlotName,String xname,String yname, boolean init) { public Plot(String PlotName, String xname, String yname, boolean init) {
if (TRACE) System.out.println("Constructor Plot "+PlotName); if (TRACE)
System.out.println("Constructor Plot " + PlotName);
m_xname = xname; m_xname = xname;
m_yname = yname; m_yname = yname;
m_PlotName = PlotName; m_PlotName = PlotName;
if (init) if (init)
init(); init();
} }
/** /**
* *
*/ */
public Plot(String PlotName,String xname,String yname) { public Plot(String PlotName, String xname, String yname) {
if (TRACE) System.out.println("Constructor Plot "+PlotName); if (TRACE)
System.out.println("Constructor Plot " + PlotName);
m_xname = xname; m_xname = xname;
m_yname = yname; m_yname = yname;
m_PlotName = PlotName; m_PlotName = PlotName;
@ -100,27 +113,29 @@ public class Plot implements PlotInterface, Serializable {
} }
protected void installButtons(JPanel buttonPan) { protected void installButtons(JPanel buttonPan) {
JButton ClearButton = new JButton ("Clear"); JButton ClearButton = new JButton("Clear");
ClearButton.addActionListener(new ActionListener() { ClearButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
clearAll(); clearAll();
} }
}); });
JButton LOGButton = new JButton ("Log/Lin"); JButton LOGButton = new JButton("Log/Lin");
LOGButton.setToolTipText("Toggle between a linear and a log scale on the y-axis."); LOGButton
.setToolTipText("Toggle between a linear and a log scale on the y-axis.");
LOGButton.addActionListener(new ActionListener() { LOGButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
m_PlotArea.toggleLog(); m_PlotArea.toggleLog();
} }
}); });
JButton ExportButton = new JButton ("Export..."); JButton ExportButton = new JButton("Export...");
ExportButton.setToolTipText("Exports the graph data to a simple ascii file."); ExportButton
.setToolTipText("Exports the graph data to a simple ascii file.");
ExportButton.addActionListener(new ActionListener() { ExportButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
exportPlot(); exportPlot();
} }
}); });
JButton DumpButton = new JButton ("Dump"); JButton DumpButton = new JButton("Dump");
DumpButton.setToolTipText("Dump the graph data to standard output"); DumpButton.setToolTipText("Dump the graph data to standard output");
DumpButton.addActionListener(new ActionListener() { DumpButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
@ -128,46 +143,61 @@ public class Plot implements PlotInterface, Serializable {
} }
}); });
JButton saveImageButton = new JButton ("Save as PNG..."); JButton saveImageButton = new JButton("Save as PNG...");
saveImageButton.addActionListener(new ActionListener() { saveImageButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
try { try {
Robot robot = new Robot(); Robot robot = new Robot();
Rectangle area; Rectangle area;
area = m_Frame.getBounds(); area = m_Frame.getBounds();
BufferedImage bufferedImage = robot.createScreenCapture(area); BufferedImage bufferedImage = robot
JFileChooser fc = new JFileChooser(); .createScreenCapture(area);
if (fc.showSaveDialog(m_Frame) != JFileChooser.APPROVE_OPTION) return; JFileChooser fc = new JFileChooser();
// System.out.println("Name " + outfile); if (fc.showSaveDialog(m_Frame) != JFileChooser.APPROVE_OPTION)
return;
// System.out.println("Name " + outfile);
try { try {
/* Old version /*
FileOutputStream fos = new FileOutputStream(fc.getSelectedFile().getAbsolutePath()+".jpeg"); * Old version FileOutputStream fos = new
BufferedOutputStream bos = new BufferedOutputStream(fos); * FileOutputStream
JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(bos); * (fc.getSelectedFile().getAbsolutePath()+".jpeg");
encoder.encode(bufferedImage); * BufferedOutputStream bos = new
bos.close();*/ * BufferedOutputStream(fos); JPEGImageEncoder encoder =
File file = new File(fc.getSelectedFile().getAbsolutePath()+".png"); * JPEGCodec.createJPEGEncoder(bos);
ImageIO.write(bufferedImage, "png", file); * encoder.encode(bufferedImage); bos.close();
/* JPEG version with javax.imageio */
float compression = 0.8f; File file = new File(fc.getSelectedFile()
FileImageOutputStream out = new FileImageOutputStream(new File(fc.getSelectedFile().getAbsolutePath()+".jpeg")); .getAbsolutePath()
ImageWriter encoder = (ImageWriter)ImageIO.getImageWritersByFormatName("JPEG").next(); + ".png");
JPEGImageWriteParam param = new JPEGImageWriteParam(null); ImageIO.write(bufferedImage, "png", file);
/*
param.setCompressionMode(ImageWriteParam.MODE_EXPLICIT); * JPEG version with javax.imageio float compression =
param.setCompressionQuality(compression); * 0.8f; FileImageOutputStream out = new
* FileImageOutputStream(new
encoder.setOutput(out); * File(fc.getSelectedFile().getAbsolutePath
encoder.write((IIOMetadata) null, new IIOImage(bufferedImage,null,null), param); * ()+".jpeg")); ImageWriter encoder =
* (ImageWriter)ImageIO
out.close(); * .getImageWritersByFormatName("JPEG").next();
* JPEGImageWriteParam param = new
* JPEGImageWriteParam(null);
*
*
* param.setCompressionMode(ImageWriteParam.MODE_EXPLICIT
* ); param.setCompressionQuality(compression);
*
* encoder.setOutput(out); encoder.write((IIOMetadata)
* null, new IIOImage(bufferedImage,null,null), param);
*
* out.close();
*/ */
} catch (Exception eee) { } catch (Exception eee) {
System.err.println("Error on exporting PNG: " + eee.getMessage()); System.err.println("Error on exporting PNG: "
+ eee.getMessage());
} }
} catch (AWTException ee) { } catch (AWTException ee) {
System.err.println("Error on creating PNG: " + ee.getMessage()); System.err.println("Error on creating PNG: "
+ ee.getMessage());
ee.printStackTrace(); ee.printStackTrace();
} }
} }
@ -177,33 +207,39 @@ public class Plot implements PlotInterface, Serializable {
buttonPan.add(LOGButton); buttonPan.add(LOGButton);
buttonPan.add(DumpButton); buttonPan.add(DumpButton);
buttonPan.add(ExportButton); buttonPan.add(ExportButton);
// m_ButtonPanel.add(PrintButton); // m_ButtonPanel.add(PrintButton);
// m_ButtonPanel.add(OpenButton); // m_ButtonPanel.add(OpenButton);
// m_ButtonPanel.add(SaveButton); // m_ButtonPanel.add(SaveButton);
buttonPan.add(saveImageButton); buttonPan.add(saveImageButton);
} }
/** /**
* *
*/ */
public void init() { public void init() {
m_Frame = new JEFrame("Plot: "+m_PlotName); m_Frame = new JEFrame("Plot: " + m_PlotName);
BasicResourceLoader loader = BasicResourceLoader.instance(); BasicResourceLoader loader = BasicResourceLoader.instance();
byte[] bytes = loader.getBytesFromResourceLocation(EvAInfo.iconLocation); byte[] bytes = loader
.getBytesFromResourceLocation(EvAInfo.iconLocation);
try { try {
m_Frame.setIconImage(Toolkit.getDefaultToolkit().createImage(bytes)); m_Frame
.setIconImage(Toolkit.getDefaultToolkit()
.createImage(bytes));
} catch (java.lang.NullPointerException e) { } catch (java.lang.NullPointerException e) {
System.err.println("Could not find EvA2 icon, please move resources folder to working directory!"); System.err
.println("Could not find EvA2 icon, please move resources folder to working directory!");
} }
m_ButtonPanel = new JPanel(); m_ButtonPanel = new JPanel();
m_PlotArea = new FunctionArea(m_xname,m_yname); m_PlotArea = new FunctionArea(m_xname, m_yname);
m_ButtonPanel.setLayout( new FlowLayout(FlowLayout.LEFT, 10,10)); m_ButtonPanel.setLayout(new FlowLayout(FlowLayout.LEFT, 10, 10));
installButtons(m_ButtonPanel); installButtons(m_ButtonPanel);
// getContentPane().smultetLayout( new GridLayout(1, 4) ); // getContentPane().smultetLayout( new GridLayout(1, 4) );
m_Frame.getContentPane().add(m_ButtonPanel,"South"); m_Frame.getContentPane().add(m_ButtonPanel, "South");
m_Frame.getContentPane().add(m_PlotArea,"Center"); // north was not so nice m_Frame.getContentPane().add(m_PlotArea, "Center"); // north was not so
// nice
m_Frame.addWindowListener(new WindowAdapter() { m_Frame.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) { public void windowClosing(WindowEvent e) {
m_PlotArea.clearAll(); // this was a memory leak m_PlotArea.clearAll(); // this was a memory leak
@ -216,28 +252,30 @@ public class Plot implements PlotInterface, Serializable {
} }
/** /**
* Draw a population to the Plot instance. Each individual is annotated with the * Draw a population to the Plot instance. Each individual is annotated with
* given prefix and its fitness. * the given prefix and its fitness.
* *
* @param prefix * @param prefix
* @param pop * @param pop
*/ */
public void drawPopulation(String prefix, Population pop) { public void drawPopulation(String prefix, Population pop) {
for (int i=0; i<pop.size(); i++) { for (int i = 0; i < pop.size(); i++) {
drawIndividual(1, 2, prefix, pop.getEAIndividual(i)); drawIndividual(1, 2, prefix, pop.getEAIndividual(i));
} }
} }
/** /**
* Draw an individual to the Plot instance. It is annotated with the * Draw an individual to the Plot instance. It is annotated with the given
* given prefix and its fitness. * prefix and its fitness.
* *
* @param prefix * @param prefix
* @param pop * @param pop
* @see FunctionArea.drawIcon * @see FunctionArea.drawIcon
*/ */
public void drawIndividual(int iconType, int graphID, String prefix, AbstractEAIndividual indy) { public void drawIndividual(int iconType, int graphID, String prefix,
getFunctionArea().drawIcon(iconType, prefix+" "+indy.getFitness(0), indy.getDoublePosition(), graphID); AbstractEAIndividual indy) {
getFunctionArea().drawIcon(iconType, prefix + " " + indy.getFitness(0),
indy.getDoublePosition(), graphID);
} }
public void setPreferredSize(Dimension prefSize) { public void setPreferredSize(Dimension prefSize) {
@ -249,7 +287,7 @@ public class Plot implements PlotInterface, Serializable {
/** /**
* Return true if the Plot object is valid. * Return true if the Plot object is valid.
* *
* @return true if the Plot object is valid * @return true if the Plot object is valid
*/ */
public boolean isValid() { public boolean isValid() {
@ -259,11 +297,13 @@ public class Plot implements PlotInterface, Serializable {
/** /**
* *
*/ */
public void setConnectedPoint (double x,double y,int func) { public void setConnectedPoint(double x, double y, int func) {
if (TRACE) System.out.println("size before is " + m_PlotArea.getPointCount(func)); if (TRACE)
m_PlotArea.setConnectedPoint(x,y,func); System.out.println("size before is "
+ m_PlotArea.getPointCount(func));
m_PlotArea.setConnectedPoint(x, y, func);
if (TRACE) { if (TRACE) {
System.out.println("added "+x+"/" + y + " to graph "+ func); System.out.println("added " + x + "/" + y + " to graph " + func);
System.out.println("size is now " + m_PlotArea.getPointCount(func)); System.out.println("size is now " + m_PlotArea.getPointCount(func));
} }
} }
@ -271,46 +311,52 @@ public class Plot implements PlotInterface, Serializable {
public int getPointCount(int graphLabel) { public int getPointCount(int graphLabel) {
return m_PlotArea.getPointCount(graphLabel); return m_PlotArea.getPointCount(graphLabel);
} }
/** /**
* *
*/ */
public void addGraph (int g1,int g2, boolean forceAdd) { public void addGraph(int g1, int g2, boolean forceAdd) {
m_PlotArea.addGraph(g1, g2, forceAdd); m_PlotArea.addGraph(g1, g2, forceAdd);
} }
/**
*
*/
public void setUnconnectedPoint (double x, double y,int GraphLabel) {
m_PlotArea.setUnconnectedPoint(x,y,GraphLabel);
}
/** /**
* *
*/ */
public void clearAll () { public void setUnconnectedPoint(double x, double y, int GraphLabel) {
m_PlotArea.setUnconnectedPoint(x, y, GraphLabel);
}
/**
*
*/
public void clearAll() {
m_PlotArea.clearAll(); m_PlotArea.clearAll();
m_PlotArea.removeAllDElements(); m_PlotArea.removeAllDElements();
m_PlotArea.clearLegend(); m_PlotArea.clearLegend();
m_Frame.repaint(); m_Frame.repaint();
} }
/** /**
* *
*/ */
public void clearGraph (int GraphNumber) { public void clearGraph(int GraphNumber) {
m_PlotArea.clearGraph(GraphNumber); m_PlotArea.clearGraph(GraphNumber);
} }
/** /**
* *
*/ */
public void setInfoString (int GraphLabel, String Info, float stroke) { public void setInfoString(int GraphLabel, String Info, float stroke) {
m_PlotArea.setInfoString(GraphLabel,Info,stroke); m_PlotArea.setInfoString(GraphLabel, Info, stroke);
} }
/** /**
* *
*/ */
public void jump () { public void jump() {
m_PlotArea.jump(); m_PlotArea.jump();
} }
/** /**
*/ */
protected Object openObject() { protected Object openObject() {
@ -320,20 +366,19 @@ public class Plot implements PlotInterface, Serializable {
if (returnVal == JFileChooser.APPROVE_OPTION) { if (returnVal == JFileChooser.APPROVE_OPTION) {
File selected = m_FileChooser.getSelectedFile(); File selected = m_FileChooser.getSelectedFile();
try { try {
ObjectInputStream oi = new ObjectInputStream(new BufferedInputStream(new FileInputStream(selected))); ObjectInputStream oi = new ObjectInputStream(
new BufferedInputStream(new FileInputStream(selected)));
Object obj = oi.readObject(); Object obj = oi.readObject();
oi.close(); oi.close();
Class ClassType = Class.forName("FunctionArea"); Class<?> ClassType = Class.forName("FunctionArea");
if (!ClassType.isAssignableFrom(obj.getClass())) if (!ClassType.isAssignableFrom(obj.getClass()))
throw new Exception("Object not of type: " + ClassType.getName()); throw new Exception("Object not of type: "
+ ClassType.getName());
return obj; return obj;
} catch (Exception ex) { } catch (Exception ex) {
JOptionPane.showMessageDialog(m_Frame, JOptionPane.showMessageDialog(m_Frame, "Couldn't read object: "
"Couldn't read object: " + selected.getName() + "\n" + ex.getMessage(),
+ selected.getName() "Open object file", JOptionPane.ERROR_MESSAGE);
+ "\n" + ex.getMessage(),
"Open object file",
JOptionPane.ERROR_MESSAGE);
} }
} }
return null; return null;
@ -356,15 +401,15 @@ public class Plot implements PlotInterface, Serializable {
if (returnVal == JFileChooser.APPROVE_OPTION) { if (returnVal == JFileChooser.APPROVE_OPTION) {
File sFile = m_FileChooser.getSelectedFile(); File sFile = m_FileChooser.getSelectedFile();
if (sFile.exists()) { if (sFile.exists()) {
returnVal = JOptionPane.showConfirmDialog(m_Frame, "The file "+sFile.getName()+" already exists. Overwrite?"); returnVal = JOptionPane.showConfirmDialog(m_Frame, "The file "
if (returnVal != JOptionPane.YES_OPTION) return; + sFile.getName() + " already exists. Overwrite?");
if (returnVal != JOptionPane.YES_OPTION)
return;
} }
if (!(m_PlotArea.exportToAscii(sFile))) { if (!(m_PlotArea.exportToAscii(sFile))) {
JOptionPane.showMessageDialog(m_Frame, JOptionPane.showMessageDialog(m_Frame,
"Couldn't write to file: " "Couldn't write to file: " + sFile.getName(),
+ sFile.getName(), "Export error", JOptionPane.ERROR_MESSAGE);
"Export error",
JOptionPane.ERROR_MESSAGE);
} }
} }
} }
@ -379,15 +424,14 @@ public class Plot implements PlotInterface, Serializable {
if (returnVal == JFileChooser.APPROVE_OPTION) { if (returnVal == JFileChooser.APPROVE_OPTION) {
File sFile = m_FileChooser.getSelectedFile(); File sFile = m_FileChooser.getSelectedFile();
try { try {
ObjectOutputStream oo = new ObjectOutputStream(new BufferedOutputStream(new FileOutputStream(sFile))); ObjectOutputStream oo = new ObjectOutputStream(
new BufferedOutputStream(new FileOutputStream(sFile)));
oo.writeObject(object); oo.writeObject(object);
oo.close(); oo.close();
} catch (IOException ex) { } catch (IOException ex) {
JOptionPane.showMessageDialog(m_Frame, JOptionPane.showMessageDialog(m_Frame,
"Couldn't write to file: " "Couldn't write to file: " + sFile.getName() + "\n"
+ sFile.getName() + ex.getMessage(), "Save object",
+ "\n" + ex.getMessage(),
"Save object",
JOptionPane.ERROR_MESSAGE); JOptionPane.ERROR_MESSAGE);
} }
} }
@ -414,6 +458,7 @@ public class Plot implements PlotInterface, Serializable {
public FunctionArea getFunctionArea() { public FunctionArea getFunctionArea() {
return m_PlotArea; return m_PlotArea;
} }
/** /**
* *
*/ */
@ -424,7 +469,7 @@ public class Plot implements PlotInterface, Serializable {
/** /**
* Add the corners of the given range as unconnected points. * Add the corners of the given range as unconnected points.
* *
* @param range * @param range
* @param graphLabel * @param graphLabel
*/ */
@ -433,23 +478,22 @@ public class Plot implements PlotInterface, Serializable {
setUnconnectedPoint(range[0][1], range[1][1], graphLabel); setUnconnectedPoint(range[0][1], range[1][1], graphLabel);
} }
// /** // /**
// * Just for testing the Plot class. // * Just for testing the Plot class.
// */ // */
// public static void main( String[] args ){ // public static void main( String[] args ){
// Plot plot = new Plot("Plot-Test","x-value","y-value"); // Plot plot = new Plot("Plot-Test","x-value","y-value");
// plot.init(); // plot.init();
// double x; // double x;
// for (x= 0; x <6000; x++) { // for (x= 0; x <6000; x++) {
// //double y = SpecialFunction.getnormcdf(x); // //double y = SpecialFunction.getnormcdf(x);
// // double yy = 0.5*SpecialFunction.getnormpdf(x); // // double yy = 0.5*SpecialFunction.getnormpdf(x);
// double n = Math.sin(((double)x/1000*Math.PI)); // double n = Math.sin(((double)x/1000*Math.PI));
// //plot.setConnectedPoint(x,Math.sin(x),0); // //plot.setConnectedPoint(x,Math.sin(x),0);
// //plot.setConnectedPoint(x,Math.cos(x),1); // //plot.setConnectedPoint(x,Math.cos(x),1);
// //plot.setConnectedPoint(x,y,0); // //plot.setConnectedPoint(x,y,0);
// plot.setConnectedPoint(x,n,1); // plot.setConnectedPoint(x,n,1);
// } // }
// //plot.addGraph(1,2); // //plot.addGraph(1,2);
// } // }
} }