public class Axis
extends java.lang.Object
toLatex method.
It provides tools to customize the axis in modifying labels and description.
| Modifier and Type | Field and Description |
|---|---|
static boolean |
ORIENTATION_HORIZONTAL |
static boolean |
ORIENTATION_VERTICAL |
| Constructor and Description |
|---|
Axis(NumberAxis inAxis,
boolean orientation)
Create a new Axis instance from an existing NumberAxis
instance with vertical (y-axis) or horizontal (x-axis) orientation.
|
| Modifier and Type | Method and Description |
|---|---|
void |
disableCustomLabels()
Disables the use of custom labels for the current axis.
|
void |
enableCustomLabels()
Enables the use of custom labels for the current axis.
|
java.lang.String |
getLabel()
Returns the axis description.
|
double |
getTwinAxisPosition()
Returns the drawing position parameter (default equals 0).
|
void |
setLabel(java.lang.String label)
Sets the axis description.
|
void |
setLabels(double tick)
Sets a periodic label display.
|
void |
setLabels(double[] position)
Sets the position of each label on this axis.
|
void |
setLabels(double[] position,
java.lang.String[] label)
Assigns custom labels to user-defined positions on the axis.
|
void |
setLabelsAuto()
Calculates and sets an automatic tick unit.
|
void |
setTwinAxisPosition(double position)
Defines where the opposite axis must be drawn on the current axis,
where it should appear, and on which label.
|
java.lang.String |
toLatex(double scale)
Formats and returns a string containing a LATEX-compatible
source code which represents this axis and its parameters.
|
public static final boolean ORIENTATION_VERTICAL
public static final boolean ORIENTATION_HORIZONTAL
public Axis(NumberAxis inAxis,
boolean orientation)
inAxis - NumberAxis instance associated to the new variable.orientation - axis direction, horizontal or verticalpublic java.lang.String getLabel()
public void setLabel(java.lang.String label)
label - axis label.public void setLabels(double tick)
tick - tick unit.public void setLabelsAuto()
public void enableCustomLabels()
setLabels must be used to set the custom labels.public void disableCustomLabels()
public void setLabels(double[] position)
enableCustomLabels
must be called before using this method.position - new label positions.public void setLabels(double[] position,
java.lang.String[] label)
enableCustomLabels
must be called before using this method.position - label series position on the axis.label - label series name on the axis.public double getTwinAxisPosition()
public void setTwinAxisPosition(double position)
position - new drawing position.public java.lang.String toLatex(double scale)
scale - current axis wished scale.To submit a bug or ask questions, send an e-mail to Pierre L'Ecuyer.