com.panayotis.gnuplot.plot
Class Graph

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.ArrayList<Plot>
              extended by com.panayotis.gnuplot.plot.Graph
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Iterable<Plot>, java.util.Collection<Plot>, java.util.List<Plot>, java.util.RandomAccess
Direct Known Subclasses:
Graph3D

public class Graph
extends java.util.ArrayList<Plot>

Graph objects are parts of a multi-plot drawing. Each graph contains other plots which share the same axis. All gnuplot objects have at least one graph object.

For single plots, better have a look at Plot objects and GNUPlot.addPlot() command

See Also:
Serialized Form

Field Summary
protected static java.lang.String NL
           
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
Graph()
          Create a new graph object
 
Method Summary
 void addPlot(Plot plot)
          Add a new plot to this plotgroup.
 Axis getAxis(java.lang.String axisname)
          Get one of the available Axis, in orde to set some parameters on it.
 LayoutMetrics getMetrics()
          Get the positioning and size of this graph object
protected  java.lang.String getPlotCommand()
          Get the actual gnuplot command to initiate the plot.
 void setMetrics(float x, float y, float width, float height)
          Set the position and size of thie graph object, relative to a 0,0-1,1 page
 
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, remove, removeRange, set, size, toArray, toArray, trimToSize
 
Methods inherited from class java.util.AbstractList
equals, hashCode, iterator, listIterator, listIterator, subList
 
Methods inherited from class java.util.AbstractCollection
containsAll, removeAll, retainAll, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
containsAll, equals, hashCode, iterator, listIterator, listIterator, removeAll, retainAll, subList
 

Field Detail

NL

protected static final java.lang.String NL
Constructor Detail

Graph

public Graph()
Create a new graph object

Method Detail

getAxis

public Axis getAxis(java.lang.String axisname)
Get one of the available Axis, in orde to set some parameters on it.

Parameters:
axisname - The name of the Axis. It is usually "x", "y", "z"
Returns:
The desired Axis

addPlot

public void addPlot(Plot plot)
Add a new plot to this plotgroup. At least one plot is needed to produce visual results.

Parameters:
plot - The given plot.

setMetrics

public void setMetrics(float x,
                       float y,
                       float width,
                       float height)
Set the position and size of thie graph object, relative to a 0,0-1,1 page

Parameters:
x - horizontal position
y - vertical position
width - width of this graph
height - of this graph

getMetrics

public LayoutMetrics getMetrics()
Get the positioning and size of this graph object

Returns:
The metrics of this object

getPlotCommand

protected java.lang.String getPlotCommand()
Get the actual gnuplot command to initiate the plot.

Returns:
This method always returns "plot"