public abstract class Axes extends Object implements Iterable<String>
GnuPlot
. GnuPlot
has a list of
Axes
objects and assumes that each of these Axes
object has one
x column (the first one), optionally one y column and n value columns.
The main access point to the data is the Iterable
interface which yields the tab
separated values of each columns row by row.
It is possible to add other Axes
object to an Axes
object. So If you
call the Iterable.iterator()
, all of the columns of each attached Axes
object will be yielded. Hence attached Axes
objects must have the
same number of rows (if they don't, an IllegalArgumentException
will be thrown).
This class also manages labels and styles for each column. If you specify either of them, then
either the length must be equal to the number of columns or 1 shorter (then the
Axes
objects knows that its first column is an x column).
The content of labels is directly passed to the plot
command as title
"label"
, the content of styles also is attached to the corresponding place in the
plot
command (e.g. styles[i]="with linespoints").
Modifier and Type | Field and Description |
---|---|
static int |
Additional |
static int |
ThreeD |
static int |
TwoD |
Constructor and Description |
---|
Axes() |
Modifier and Type | Method and Description |
---|---|
void |
addAxes(Axes axes)
Attaches an
Axes object to this one. |
void |
applyDefaultStyle(String defaultStyle)
Sets the style of each column to the default style except for columns that already have a
style.
|
int |
getDimensionType()
Gets if this Axes object contains 2 or 3 dimensional data.
|
String |
getLabel(int col)
Gets the label for a column.
|
Number |
getNumber(int row,
int col)
Gets the entry of this axes at the specified position.
|
abstract int |
getNumColumns()
Gets the number of columns.
|
abstract int |
getNumRows()
Gets the number of rows.
|
String |
getStyle(int col)
Gets the style for a column.
|
Number |
getX(int row) |
void |
setLabel(int col,
String label)
Sets the label for a column.
|
void |
setStyle(int col,
String style)
Sets the style for a column.
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, iterator, spliterator
public static final int TwoD
public static final int ThreeD
public static final int Additional
public int getDimensionType()
TwoD
,
ThreeD
,
Additional
public void addAxes(Axes axes)
Axes
object to this one. It cannot have an Axes
object
with an x axis (which means that the labels/styles array is 1 shorter then the number of
columns).
Additionally the numbers of rows must be equal.
axes
- the Axes
object to attachpublic abstract int getNumColumns()
Axes
object is also
included.public abstract int getNumRows()
public Number getX(int row)
public Number getNumber(int row, int col)
row
- the row of the entrycol
- the col of the entrypublic void setLabel(int col, String label)
Axes
object has a x axis, the label of the
0th column cannot be set (because it is the x axis).col
- zero based index of the columnlabel
- label for the columnpublic String getLabel(int col)
Axes
object has a x axis, the label of the
0th column cannot be retrieved (because it is the x axis).col
- zero based index of the columnpublic void setStyle(int col, String style)
Axes
object has a x axis, the style of the
0th column cannot be set (because it is the x axis).col
- zero based index of the columnstyle
- style for the columnpublic String getStyle(int col)
Axes
object has a x axis, the style of the
0th column cannot be retrieved (because it is the x axis).col
- zero based index of the column style style for the columnpublic void applyDefaultStyle(String defaultStyle)
defaultStyle
- the default style to setCopyright © 2007–2021. All rights reserved.