Class Axis

java.lang.Object
smile.plot.swing.Axis

public class Axis extends Object
This class describes an axis of a coordinate system.
  • Constructor Details

    • Axis

      public Axis(Base base, int index)
      Constructor.
  • Method Details

    • reset

      public void reset()
      Set the base coordinate space.
    • setRotation

      public Axis setRotation(double rotation)
      Sets the rotation degree of tick strings.
      Parameters:
      rotation - rotation degree.
    • setTicks

      public void setTicks(String[] ticks, double[] location)
      Add a label to the axis at given location.
    • slices

      public int slices()
      Returns the number of slices in linear scale.
    • setGridVisible

      public Axis setGridVisible(boolean v)
      Set the visibility of the grid lines and their labels.
    • isGridVisible

      public boolean isGridVisible()
      Returns the visibility of the grid lines and their labels.
    • setFrameVisible

      public Axis setFrameVisible(boolean v)
      Set the visibility of the frame grid lines and their labels.
    • isFrameVisible

      public boolean isFrameVisible()
      Returns the visibility of the frame grid lines and their labels.
    • setTickVisible

      public Axis setTickVisible(boolean v)
      Set the visibility of the axis label.
    • isTickVisible

      public boolean isTickVisible()
      Returns the visibility of the axis label.
    • setLabel

      public void setLabel(String label)
      Sets the label.
    • getLabel

      public String getLabel()
      Returns the label of the axis.
    • paint

      public void paint(Graphics g)
      Draw the axis.