# Class LinesPlotState

java.lang.Object
uk.ac.starlink.ttools.plot.PlotState
uk.ac.starlink.ttools.plot.LinesPlotState

public class LinesPlotState extends PlotState
PlotState subclass for use with stacked line plots.

Since:
  3 Mar 2006
Author:
  Mark Taylor

## Nested Class Summary

### Nested classes/interfaces inherited from class PlotState

`PlotState.SimpleValueInfo`

## Constructor Summary

Constructors
Constructor
Description
`LinesPlotState(int ngraph)`
Constructs a new state.

## Method Summary

Modifier and Type
Method
Description
`String`
`compare(PlotState o)`
Returns a string giving a list of items in which this state differs from a given state `o`.
`boolean`
`equals(Object o)`
`int`
`getGraphCount()`
Returns the number of graphs in the stack.
`int[]`
`getGraphIndices()`
Returns the mapping of subsets to graph indices.
`uk.ac.starlink.table.ValueInfo[]`
`getYAxes()`
Returns the metatdata for the different Y axes to be plotted (one for each graph).
`String[]`
`getYAxisLabels()`
Returns the text labels for the different Y axes to be plotted (one for each graph).
`ValueConverter[]`
`getYConverters()`
Returns the array of numeric converter objects, one for the Y axis of each graph.
`boolean[]`
`getYFlipFlags()`
Returns flags for which Y axes will be plotted inverted (one for each graph).
`boolean[]`
`getYLogFlags()`
Returns flags for which Y axes will be plotted logarithmically (one for each graph).
`double[][]`
`getYRanges()`
Returns the data ranges for each different Y axis (one for each graph).
`boolean`
`getYZeroFlag()`
Returns whether a line should be drawn at y=0 on all the graphs.
`int`
`hashCode()`
`void`
`setGraphIndices(int[] graphIndices)`
Sets the mapping of subsets to graph indices.
`void`
`setYAxes(uk.ac.starlink.table.ValueInfo[] yAxes)`
Sets the metadata for the different Y axes to be plotted (one for each graph).
`void`
`setYAxisLabels(String[] yAxisLabels)`
Sets the text labels for the different Y axes to be plotted (one for each graph).
`void`
`setYConverters(ValueConverter[] yConverters)`
Sets an array of numeric converter objects, one for the Y axis of each graph.
`void`
`setYFlipFlags(boolean[] yFlipFlags)`
Sets flags for which Y axes will be plotted inverted (one for each graph).
`void`
`setYLogFlags(boolean[] yLogFlags)`
Sets flags for which Y axes will be plotted logarithmically (one for each graph).
`void`
`setYRanges(double[][] yRanges)`
Sets data ranges for each different Y axis (one for each graph).
`void`
`setYZeroFlag(boolean yZeroFlag)`
Sets whether a line should be drawn at y=0 on all the graphs.

### Methods inherited from class PlotState

`getAntialias, getAxes, getAxisLabels, getConverters, getFlipFlags, getGrid, getLogFlags, getMainNdim, getPlotData, getRanges, getShaders, getValid, setAntialias, setAxes, setAxisLabels, setConverters, setFlipFlags, setGrid, setLogFlags, setMainNdim, setPlotData, setRanges, setShaders, setValid`

### Methods inherited from class Object

`clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### LinesPlotState

public LinesPlotState(int ngraph)
Constructs a new state.

Parameters:
  `ngraph` - number of graphs in the stack

## Method Details

### getGraphCount

public int getGraphCount()
Returns the number of graphs in the stack.

Returns:
  graph count

### setYAxes

public void setYAxes(uk.ac.starlink.table.ValueInfo[] yAxes)
Sets the metadata for the different Y axes to be plotted (one for each graph). Note the submitted `axes` array is not used directly, the relevant information is abstracted from it and stored (subsequent calls of `getYAxes()` will not return the same array or component objects).

Parameters:
  `yAxes` - Y axis metadata array

### setYAxisLabels

public void setYAxisLabels(String[] yAxisLabels)
Sets the text labels for the different Y axes to be plotted (one for each graph).

Parameters:
  `yAxisLabels` - Y axis label array

### getYAxisLabels

public String[] getYAxisLabels()
Returns the text labels for the different Y axes to be plotted (one for each graph).

Returns:
  Y axis label array

### getYAxes

public uk.ac.starlink.table.ValueInfo[] getYAxes()
Returns the metatdata for the different Y axes to be plotted (one for each graph).

Returns:
  Y axis metadata array

### setYRanges

public void setYRanges(double[][] yRanges)
Sets data ranges for each different Y axis (one for each graph). `yRanges` is an N-element array of 2-element double arrays. Each of its elements gives (low,high) limits for the data to be considered. Either or both elements may be NaN. A non-NaN value is considered as a request to fix the lower/upper limit of the indicated axis to the value given. A NaN value normally means that the limit should be determined dynamically (by assessing the range of the available data points).

Parameters:
  `yRanges` - array of (low,high) fixed range limits

### getYRanges

public double[][] getYRanges()
Returns the data ranges for each different Y axis (one for each graph).

Returns:
  array of (low,high) fixed range limits
See Also:
  - `PlotState.setRanges(double[][])`

### setYLogFlags

public void setYLogFlags(boolean[] yLogFlags)
Sets flags for which Y axes will be plotted logarithmically (one for each graph).

Parameters:
  `yLogFlags` - Y log flags

### getYLogFlags

public boolean[] getYLogFlags()
Returns flags for which Y axes will be plotted logarithmically (one for each graph).

Returns:
  Y log flags

### setYFlipFlags

public void setYFlipFlags(boolean[] yFlipFlags)
Sets flags for which Y axes will be plotted inverted (one for each graph).

Parameters:
  `yFlipFlags` - Y flip flags

### getYFlipFlags

public boolean[] getYFlipFlags()
Returns flags for which Y axes will be plotted inverted (one for each graph).

Returns:
  Y flip flags

### setYZeroFlag

public void setYZeroFlag(boolean yZeroFlag)
Sets whether a line should be drawn at y=0 on all the graphs.

Parameters:
  `yZeroFlag` - true to draw y=0 lines

### getYZeroFlag

public boolean getYZeroFlag()
Returns whether a line should be drawn at y=0 on all the graphs.

Returns:
  true to draw y=0 lines

### setYConverters

public void setYConverters(ValueConverter[] yConverters)
Sets an array of numeric converter objects, one for the Y axis of each graph. The `ValueConverter.unconvert(Object)` method of these should convert a numeric value back to the formatted (text) version of a value on the corresponding axis. Any of the elements may be null if the value is numeric anyway.

Parameters:
  `yConverters` - Y numeric converter array, one for each graph

### getYConverters

public ValueConverter[] getYConverters()
Returns the array of numeric converter objects, one for the Y axis of each graph.

Returns:
  Y numeric converter array, one for each graph

### setGraphIndices

public void setGraphIndices(int[] graphIndices)
Sets the mapping of subsets to graph indices. This defines which graph each subset will be displayed in. The i'th element of the array gives the index of the graph that subset i will be displayed in.

Parameters:
  `graphIndices` - subset to graph mapping

### getGraphIndices

public int[] getGraphIndices()
Returns the mapping of subsets to graph indices.

Returns:
  subset to graph mapping

### equals

public boolean equals(Object o)

Overrides:
  `equals` in class `PlotState`

### compare

public String compare(PlotState o)
Description copied from class: `PlotState`
Returns a string giving a list of items in which this state differs from a given state `o`. This method is used only for debugging purposes, and may not be fully implemented at any given time.

Overrides:
  `compare` in class `PlotState`
Parameters:
  `o` - state for comparison with this one
Returns:
  text summary of differences

### hashCode

public int hashCode()

Overrides:
  `hashCode` in class `PlotState`