A plot represents a mathematical transformation used by {@link JXGraph}. When a plot belongs to a graph, the graph component asks for the transformation of a value along the X axis. The resulting value defines the Y coordinates at which the graph must draw a spot of color.
Here is a sample implementation of this class that draws a straight line once added to a graph (it follows the well-known equation y=a.x+b):
class LinePlot extends JXGraph.Plot { public double compute(double value) { return 2.0 * value + 1.0; } }
When a plot is added to an instance of JXGraph
, the JXGraph
automatically becomes a new property change listener of the plot. If property change events are fired, the graph will be updated accordingly.
More information about plots usage can be found in {@link JXGraph} inthe section entitled Plots.
@see JXGraph @see JXGraph#addPlots(Color,JXGraph.Plot)
|
|