Package smile.plot.swing
Class Axis
java.lang.Object
smile.plot.swing.Axis
This class describes an axis of a coordinate system.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetLabel()
Returns the label of the axis.boolean
Returns the visibility of the frame grid lines and their labels.boolean
Returns the visibility of the grid lines and their labels.boolean
Returns the visibility of the tick labels.void
Draws the axis.void
reset()
Resets the base coordinate space.setFrameVisible
(boolean visible) Set the visibility of the frame grid lines and their labels.setGridVisible
(boolean visible) Sets the visibility of the grid lines and their labels.void
Sets the label.setRotation
(double rotation) Sets the rotation degree of tick strings.Adds a label to the axis at given location.setTickVisible
(boolean visible) Sets the visibility of the tick labels.int
slices()
Returns the number of slices in linear scale.
-
Constructor Details
-
Axis
Constructor.- Parameters:
base
- The base coordinate space.index
- The index of coordinate associated with this axis.
-
-
Method Details
-
reset
public void reset()Resets the base coordinate space. -
setRotation
Sets the rotation degree of tick strings.- Parameters:
rotation
- rotation degree.- Returns:
- this object.
-
setTicks
Adds a label to the axis at given location.- Parameters:
ticks
- the tick labels.location
- the tick location.- Returns:
- this object.
-
slices
public int slices()Returns the number of slices in linear scale.- Returns:
- the number of slices in linear scale.
-
setGridVisible
Sets the visibility of the grid lines and their labels.- Parameters:
visible
- the flag if the grid is visible.- Returns:
- this object.
-
isGridVisible
public boolean isGridVisible()Returns the visibility of the grid lines and their labels.- Returns:
- true if the grid is visible.
-
setFrameVisible
Set the visibility of the frame grid lines and their labels.- Parameters:
visible
- the flag if the frame is visible.- Returns:
- this object.
-
isFrameVisible
public boolean isFrameVisible()Returns the visibility of the frame grid lines and their labels.- Returns:
- true if the frame is visible.
-
setTickVisible
Sets the visibility of the tick labels.- Parameters:
visible
- the flag if the ticks are visible.- Returns:
- this object.
-
isTickVisible
public boolean isTickVisible()Returns the visibility of the tick labels.- Returns:
- true if the ticks are visible.
-
setLabel
Sets the label.- Parameters:
label
- the label of the axis.
-
getLabel
Returns the label of the axis.- Returns:
- the label of the axis.
-
paint
Draws the axis.- Parameters:
g
- the renderer.
-