# Class Trimming

java.lang.Object
uk.ac.starlink.ttools.plot2.Trimming

public class Trimming extends Object
Aggregates static items that decorate a rectangular plotting area. The area may be that occupied by a single plot zone or by a collection of zones.

Since:
  14 Jul 2023
Author:
  Mark Taylor

## Constructor Summary

Constructors
Constructor
Description
`Trimming(Icon legend, float[] legPos, String title)`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`Icon`
`getLegend()`
Returns legend icon.
`float[]`
`getLegendPosition()`
Returns legend position if internal legend is required.
`String`
`getTitle()`
Returns plot title if required.

### Methods inherited from class Object

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

## Constructor Details

### Trimming

public Trimming(Icon legend, float[] legPos, String title)
Constructor.

Parameters:
  `legend` - legend icon if required, or null
  `legPos` - legend position if internal legend is required; 2-element (x,y) array, each element in range 0-1
  `title` - title text, or null

## Method Details

### getLegend

public Icon getLegend()
Returns legend icon.

Returns:
  legend icon, or null

### getLegendPosition

public float[] getLegendPosition()
Returns legend position if internal legend is required. The numeric values refer to the fractional distance in each dimension at which the legend is positioned within the target rectangular region.

Returns:
  2-element (x,y) array, each element in range 0-1, or null

### getTitle

public String getTitle()
Returns plot title if required.

Returns:
  title text, or null