// Path: src/org/gwoptics/testing/Scatter_label_test.java
// class Point2D {
// 
//   public float X, Y;
// 
//   public Point2D(float x, float y) {
//     X = x;
//     Y = y;
//   }
// }


import java.util.ArrayList;
import org.gwoptics.graphics.graph2D.*;
import org.gwoptics.graphics.graph2D.traces.Blank2DTrace;
import org.gwoptics.testing.Scatter_label_test.Point2D;
import processing.core.PApplet;
import processing.core.PFont;

      _data.add(new Point2D(x, y));
    }

    private void drawPoint(Point2D p, PlotRenderer pr) {
      p.X = pr.valToX(p.X);
      p.Y = pr.valToX(p.Y);
      
      pr.canvas.pushStyle();
      pr.canvas.stroke(255, 0, 0);
      pr.canvas.strokeCap(PApplet.SQUARE);
      pr.canvas.strokeWeight(1f);
      pr.canvas.line(p.X - pSize, p.Y, p.X + pSize, p.Y);
      pr.canvas.line(p.X, p.Y - pSize, p.X, p.Y + pSize);
      pr.canvas.popStyle();
      
      // The BlankCanvas trace works by creating a scaled canvas on which
      // we draw, if we try and draw text to it though this will also be
      // scaled and looks ugly. For a hack we can undo this scaling then
      // draw the text, easy...
      pr.canvas.pushMatrix();  
      // -1 for the y is needed here as the coordinate system in Blank canvas is
      // flipped to be like a normal graph, rather than screen coordinates
      pr.canvas.scale(1, -1f);
      pr.canvas.textFont(myFont);
      pr.canvas.text(String.format("(%.1f, %.1f)", p.X, p.Y), p.X + 5, -(p.Y - 5));
      pr.canvas.popMatrix();
    }

    @Override public void TraceDraw(PlotRenderer p) {
      if (_data != null) {

// Path: src/org/gwoptics/testing/Scatter_label_test.java
// class Point2D {
// 
//   public float X, Y;
// 
//   public Point2D(float x, float y) {
//     X = x;
//     Y = y;
//   }
// }


// Path: src/org/gwoptics/testing/Scatter_label_test.java
import java.util.ArrayList;
import org.gwoptics.graphics.graph2D.*;
import org.gwoptics.graphics.graph2D.traces.Blank2DTrace;
import org.gwoptics.testing.Scatter_label_test.Point2D;
import processing.core.PApplet;
import processing.core.PFont;

      _data.add(new Point2D(x, y));
    }

    private void drawPoint(Point2D p, PlotRenderer pr) {
      p.X = pr.valToX(p.X);
      p.Y = pr.valToX(p.Y);
      
      pr.canvas.pushStyle();
      pr.canvas.stroke(255, 0, 0);
      pr.canvas.strokeCap(PApplet.SQUARE);
      pr.canvas.strokeWeight(1f);
      pr.canvas.line(p.X - pSize, p.Y, p.X + pSize, p.Y);
      pr.canvas.line(p.X, p.Y - pSize, p.X, p.Y + pSize);
      pr.canvas.popStyle();
      
      // The BlankCanvas trace works by creating a scaled canvas on which
      // we draw, if we try and draw text to it though this will also be
      // scaled and looks ugly. For a hack we can undo this scaling then
      // draw the text, easy...
      pr.canvas.pushMatrix();  
      // -1 for the y is needed here as the coordinate system in Blank canvas is
      // flipped to be like a normal graph, rather than screen coordinates
      pr.canvas.scale(1, -1f);
      pr.canvas.textFont(myFont);
      pr.canvas.text(String.format("(%.1f, %.1f)", p.X, p.Y), p.X + 5, -(p.Y - 5));
      pr.canvas.popMatrix();
    }

    @Override public void TraceDraw(PlotRenderer p) {
      if (_data != null) {

        for (int i = 0; i < _data.size(); i++) {
