class ScatterPlotAxis{ private int graphX; // x of graph private int graphY; // y of graph private float graphW; // width of graph private float graphH; // height of graph private String xAxis; // y Axis points private String yAxis; // x Axis points ScatterPlotAxis(int graphX, int graphY, float graphW, float graphH, String xAxis, String yAxis) { this.graphX = graphX; // make the variables that are called equal variables here this.graphY = graphY; this.graphW = graphW; this.graphH = graphH; this.xAxis = xAxis; this.yAxis = yAxis; } void drawGraph() { pushMatrix(); translate(graphX, graphY); // push graph to start at graphX, graphY stroke(0); // black stroke // Draw x & y axis line(0, 0, graphW, 0); line(0, 0, 0, -graphH); // Draw increment lines float incrementX = graphW/10; float incrementY = graphH/10; if(xAxis.equals("Sepal Width")) // sepal width on x axis data is scaled by 2x { incrementX*=2; } if(yAxis.equals("Sepal Width")) // sepal width data on y axis is scaled by 2x { incrementY*=2; } if(xAxis.equals("Petal Width")) // petal width on x axis data is scaled by 2x { incrementX*=3; } if(yAxis.equals("Petal Width")) // petal width on y axis data is scaled by 2x { incrementY*=3; } for(int i = 0; i <= graphW; i+=incrementX) // dash increments on x axis { line(i, 0, i, 5); } for(int i = 0; i <= graphH; i+=incrementY) // dash increments on y axis { line(0, -i, -5, -i); } popMatrix(); } }