Represents an axis of a chart encapsulated by an instance of XYChart.
More...
|
| | Axis (NumberAxis inAxis, boolean orientation) |
| | Create a new Axis instance from an existing NumberAxis instance with vertical ( \(y\)-axis) or horizontal ( \(x\)-axis) orientation.
|
| String | getLabel () |
| | Returns the axis description.
|
| void | setLabel (String label) |
| | Sets the axis description.
|
| void | setLabels (double tick) |
| | Sets a periodic label display.
|
| void | setLabelsAuto () |
| | Calculates and sets an automatic tick unit.
|
|
| NumberAxis | getAxis () |
| | Returns the NumberAxis instance (from JFreeChart) linked with the current variable.
|
|
| void | enableCustomLabels () |
| | Not used anymore.
|
| void | disableCustomLabels () |
| | Not used anymore.
|
| void | setLabels (double[] position) |
| | Sets the position of each label on this axis.
|
| void | setLabels (double[] position, String[] label) |
| | Assigns custom labels to user-defined positions on the axis.
|
| double | getTwinAxisPosition () |
| | Returns the drawing position parameter (default equals 0).
|
| void | setTwinAxisPosition (double position) |
| | Defines where the opposite axis must be drawn on the current axis, where it should appear, and on which label.
|
| String | toLatex (double scale) |
| | Formats and returns a string containing a LaTeX-compatible source code which represents this axis and its parameters.
|
Represents an axis of a chart encapsulated by an instance of XYChart.
Axis uses the JFreeChart class NumberAxis to store some axis properties. This class represents the \(x\)-axis or the \(y\)-axis of a XYChart and, consequently, is drawn when calling the toLatex method. It provides tools to customize the axis in modifying labels and description.
Definition at line 42 of file Axis.java.
◆ Axis()
| umontreal.ssj.charts.Axis.Axis |
( |
NumberAxis | inAxis, |
|
|
boolean | orientation ) |
Create a new Axis instance from an existing NumberAxis instance with vertical ( \(y\)-axis) or horizontal ( \(x\)-axis) orientation.
- Parameters
-
| inAxis | NumberAxis instance associated to the new variable. |
| orientation | axis direction, horizontal or vertical |
Definition at line 79 of file Axis.java.
◆ disableCustomLabels()
| void umontreal.ssj.charts.Axis.disableCustomLabels |
( |
| ) |
|
◆ enableCustomLabels()
| void umontreal.ssj.charts.Axis.enableCustomLabels |
( |
| ) |
|
◆ getAxis()
| NumberAxis umontreal.ssj.charts.Axis.getAxis |
( |
| ) |
|
|
protected |
Returns the NumberAxis instance (from JFreeChart) linked with the current variable.
- Returns
- the NumberAxis instance (from JFreeChart) linked with the current variable.
Definition at line 98 of file Axis.java.
◆ getLabel()
| String umontreal.ssj.charts.Axis.getLabel |
( |
| ) |
|
Returns the axis description.
- Returns
- the axis description.
Definition at line 107 of file Axis.java.
◆ getTwinAxisPosition()
| double umontreal.ssj.charts.Axis.getTwinAxisPosition |
( |
| ) |
|
Returns the drawing position parameter (default equals 0).
- Returns
- drawing position parameter.
Definition at line 211 of file Axis.java.
◆ setLabel()
| void umontreal.ssj.charts.Axis.setLabel |
( |
String | label | ) |
|
Sets the axis description.
This description will be displayed on the chart, near the axis.
- Parameters
-
Definition at line 117 of file Axis.java.
◆ setLabels() [1/3]
| void umontreal.ssj.charts.Axis.setLabels |
( |
double | tick | ) |
|
Sets a periodic label display.
Labels will be shown every tick unit. This tick unit replaces the default unit.
- Parameters
-
Definition at line 127 of file Axis.java.
◆ setLabels() [2/3]
| void umontreal.ssj.charts.Axis.setLabels |
( |
double[] | position | ) |
|
Sets the position of each label on this axis.
This method requires an array containing an increasing sequence of numbers representing the positions at which labels will appear on the axis. It is designed to export the axis to a LaTeX source code; it has no effect on the chart appearance displayed with XYChart.view().
- Parameters
-
| position | new label positions. |
Definition at line 169 of file Axis.java.
◆ setLabels() [3/3]
| void umontreal.ssj.charts.Axis.setLabels |
( |
double[] | position, |
|
|
String[] | label ) |
Assigns custom labels to user-defined positions on the axis.
This method requires an array of positions as well as an array of labels. The label label[i] will be used at position position[i]. It is designed to export the axis to a LaTeX source code, and to use LaTeX/TikZ commands to write prettier characters; it has no effect on the chart appearance displayed with XYChart.view().
- Parameters
-
| position | label series position on the axis. |
| label | label series name on the axis. |
Definition at line 192 of file Axis.java.
◆ setLabelsAuto()
| void umontreal.ssj.charts.Axis.setLabelsAuto |
( |
| ) |
|
Calculates and sets an automatic tick unit.
Definition at line 135 of file Axis.java.
◆ setTwinAxisPosition()
| void umontreal.ssj.charts.Axis.setTwinAxisPosition |
( |
double | position | ) |
|
Defines where the opposite axis must be drawn on the current axis, where it should appear, and on which label.
- Parameters
-
| position | new drawing position. |
Definition at line 221 of file Axis.java.
◆ toLatex()
| String umontreal.ssj.charts.Axis.toLatex |
( |
double | scale | ) |
|
Formats and returns a string containing a LaTeX-compatible source code which represents this axis and its parameters.
- Returns
- LaTeX source code in a String.
- Parameters
-
| scale | current axis wished scale. |
Definition at line 233 of file Axis.java.
The documentation for this class was generated from the following file: