Table of Contents

Class AxisManager

Namespace
ScottPlot
Assembly
ScottPlot.dll
public class AxisManager
Inheritance
AxisManager
Inherited Members
Extension Methods

Constructors

AxisManager(Plot)

Contains state and logic for axes

public AxisManager(Plot plot)

Parameters

plot Plot

Properties

AllGrids

Return the DefaultGrid and all CustomGrids

public List<IGrid> AllGrids { get; }

Property Value

List<IGrid>

AutoScaler

Logic that determines padding around the data area when AutoScale() is called

public IAutoScaler AutoScaler { get; set; }

Property Value

IAutoScaler

Bottom

The primary horizontal axis below the plot

public IXAxis Bottom { get; }

Property Value

IXAxis

ContinuousAutoscaleAction

When ContinuouslyAutoscale is true, this action is called before each frame is rendered. Users can assign their own static function to customize continuous autoscaling behavior.

public Action<RenderPack> ContinuousAutoscaleAction { get; set; }

Property Value

Action<RenderPack>

ContinuouslyAutoscale

If enabled, AutoScale() will be called at the start of each render. This can negatively impact performance of plots with an extremely large number of data points.

public bool ContinuouslyAutoscale { get; set; }

Property Value

bool

CustomGrids

List of custom grids. If in use, it is likely the default grid visibility should be disabled.

public List<IGrid> CustomGrids { get; }

Property Value

List<IGrid>

DefaultGrid

The standard grid that is added when a Plot is created. Users can achieve custom grid functionality by disabling the visibility of this grid and adding their own classes to the List of CustomGrids.

public DefaultGrid DefaultGrid { get; set; }

Property Value

DefaultGrid

Left

The primary vertical axis to the left of the plot

public IYAxis Left { get; }

Property Value

IYAxis

LimitsHaveBeenSet

Indicates whether the axis limits have been set (manually or by autoscale)

public bool LimitsHaveBeenSet { get; }

Property Value

bool

Right

The primary vertical axis to the right of the plot

public IYAxis Right { get; }

Property Value

IYAxis

Rules

Rules that are applied before each render

public List<IAxisRule> Rules { get; }

Property Value

List<IAxisRule>

Title

A special panel

public TitlePanel Title { get; }

Property Value

TitlePanel

Top

The primary horizontal axis above the plot

public IXAxis Top { get; }

Property Value

IXAxis

Methods

AddBottomAxis()

Crete a new axis, add it to the plot, and return it

public BottomAxis AddBottomAxis()

Returns

BottomAxis

AddBottomAxis(IXAxis)

public void AddBottomAxis(IXAxis axis)

Parameters

axis IXAxis

AddLeftAxis()

Crete a new axis, add it to the plot, and return it

public LeftAxis AddLeftAxis()

Returns

LeftAxis

AddLeftAxis(IYAxis)

public void AddLeftAxis(IYAxis axis)

Parameters

axis IYAxis

AddPanel(IPanel)

public void AddPanel(IPanel panel)

Parameters

panel IPanel

AddRightAxis()

Crete a new axis, add it to the plot, and return it

public RightAxis AddRightAxis()

Returns

RightAxis

AddRightAxis(IYAxis)

public void AddRightAxis(IYAxis axis)

Parameters

axis IYAxis

AddTopAxis()

Crete a new axis, add it to the plot, and return it

public TopAxis AddTopAxis()

Returns

TopAxis

AddTopAxis(IXAxis)

public void AddTopAxis(IXAxis axis)

Parameters

axis IXAxis

AddXAxis(IXAxis)

public void AddXAxis(IXAxis axis)

Parameters

axis IXAxis

AddYAxis(IYAxis)

public void AddYAxis(IYAxis axis)

Parameters

axis IYAxis

AntiAlias(bool)

Set anti-aliasing for axis frames, tick marks, and grid lines

public void AntiAlias(bool enable)

Parameters

enable bool

ApplyLinkedAxisRules()

This is called in the render system after AxisLimitsChanged has been invoked

public void ApplyLinkedAxisRules()

AutoScale(IXAxis, IYAxis, bool, bool)

Autoscale the given axes to accommodate the data from all plottables that use them

public void AutoScale(IXAxis xAxis, IYAxis yAxis, bool horizontal = true, bool vertical = true)

Parameters

xAxis IXAxis
yAxis IYAxis
horizontal bool
vertical bool

AutoScale(IEnumerable<IPlottable>)

Autoscale the default (left and bottom) axis limits to fit the data of the supplied plottables

public void AutoScale(IEnumerable<IPlottable> plottables)

Parameters

plottables IEnumerable<IPlottable>

AutoScale(bool?, bool?)

Automatically scale all axes to fit the data in all plottables

public void AutoScale(bool? invertX = null, bool? invertY = null)

Parameters

invertX bool?
invertY bool?

AutoScaleExpand()

Automatically expand the default axes to fit the data in all plottables.

public void AutoScaleExpand()

AutoScaleExpand(IXAxis, IYAxis)

Automatically expand the provided axes to fit the data in all plottables.

public void AutoScaleExpand(IXAxis xAxis, IYAxis yAxis)

Parameters

xAxis IXAxis
yAxis IYAxis

AutoScaleExpandX()

Automatically expand the default horizontal axis to fit the data in all plottables.

public void AutoScaleExpandX()

AutoScaleExpandX(IXAxis)

Automatically expand the provided axes horizontally to fit the data in all plottables.

public void AutoScaleExpandX(IXAxis xAxis)

Parameters

xAxis IXAxis

AutoScaleExpandY()

Automatically expand the default vertical axis to fit the data in all plottables.

public void AutoScaleExpandY()

AutoScaleExpandY(IYAxis)

Automatically expand the provided axes vertically to fit the data in all plottables.

public void AutoScaleExpandY(IYAxis yAxis)

Parameters

yAxis IYAxis

AutoScaleX()

Autoscale the bottom horizontal axis limits to fit the data of all plotted objects

public void AutoScaleX()

AutoScaleX(IXAxis)

Autoscale the supplied horizontal axis limits to fit the data of all plotted objects

public void AutoScaleX(IXAxis xAxis)

Parameters

xAxis IXAxis

AutoScaleX(IEnumerable<IPlottable>)

Autoscale the default bottom horizontal axis limits to fit the data of the supplied plottables

public void AutoScaleX(IEnumerable<IPlottable> plottables)

Parameters

plottables IEnumerable<IPlottable>

AutoScaleY()

Autoscale the left vertical axis limits to fit the data of all plotted objects

public void AutoScaleY()

AutoScaleY(IYAxis)

Autoscale the supplied vertical axis limits to fit the data of all plotted objects

public void AutoScaleY(IYAxis yAxis)

Parameters

yAxis IYAxis

AutoScaleY(IEnumerable<IPlottable>)

Autoscale the default left vertical axis limits to fit the data of the supplied plottables

public void AutoScaleY(IEnumerable<IPlottable> plottables)

Parameters

plottables IEnumerable<IPlottable>

Color(Color)

Apply a single color to the label, tick labels, tick marks, and frame of all axes

public void Color(Color color)

Parameters

color Color

Color(IAxis, Color)

Apply a single color to the label, tick labels, tick marks, and frame of the specified axis

public void Color(IAxis axis, Color color)

Parameters

axis IAxis
color Color

DateTimeTicksBottom()

Remove all bottom axes, create a DateTime bottom axis, add it to the plot, and return it.

public DateTimeXAxis DateTimeTicksBottom()

Returns

DateTimeXAxis

DefaultContinuousAutoscaleAction(RenderPack)

public static void DefaultContinuousAutoscaleAction(RenderPack rp)

Parameters

rp RenderPack

Frame(bool)

Set visibility of the frame on every axis

public void Frame(bool enable)

Parameters

enable bool

FrameColor(Color)

Set color of the frame on every axis

public void FrameColor(Color color)

Parameters

color Color

FrameWidth(float)

Set thickness of the frame on every axis

public void FrameWidth(float width)

Parameters

width float

Frameless(bool)

Helper method to set visibility of all axes and title panels. Hiding all panels allows the data area to the extend to the edge of the figure. This method hides the title, but call "Plot.Title()" to re-enable it.

public void Frameless(bool hideAllPanels = true)

Parameters

hideAllPanels bool

GetAxes()

All axes

public IEnumerable<IAxis> GetAxes()

Returns

IEnumerable<IAxis>

GetAxes(Edge)

All axes with the given edge

public IEnumerable<IAxis> GetAxes(Edge edge)

Parameters

edge Edge

Returns

IEnumerable<IAxis>

GetDataLimits()

Return the 2D axis limits of data for all plottables using the default axes

public AxisLimits GetDataLimits()

Returns

AxisLimits

GetDataLimits(IXAxis, IYAxis)

Return the 2D axis limits of data for all plottables using the given axes

public AxisLimits GetDataLimits(IXAxis xAxis, IYAxis yAxis)

Parameters

xAxis IXAxis
yAxis IYAxis

Returns

AxisLimits

GetLimits()

Return the 2D axis limits for the default axes

public AxisLimits GetLimits()

Returns

AxisLimits

GetLimits(IAxes)

Return the 2D axis limits for the given X/Y axis pair

public AxisLimits GetLimits(IAxes axes)

Parameters

axes IAxes

Returns

AxisLimits

GetLimits(IXAxis, IYAxis)

Return the 2D axis limits for the given X/Y axis pair

public AxisLimits GetLimits(IXAxis xAxis, IYAxis yAxis)

Parameters

xAxis IXAxis
yAxis IYAxis

Returns

AxisLimits

GetPanels()

Returns all axes, panels, and the title

public IPanel[] GetPanels()

Returns

IPanel[]

GetXAxes()

All X axes

public IEnumerable<IXAxis> GetXAxes()

Returns

IEnumerable<IXAxis>

GetYAxes()

All Y axes

public IEnumerable<IYAxis> GetYAxes()

Returns

IEnumerable<IYAxis>

Hairline(bool)

Hairline mode causes lines to always render exactly 1 pixel wide regardless of ScaleFactor. This function controls hairline behavior for all axis frames. tick marks, and grid lines.

public void Hairline(bool enable)

Parameters

enable bool

InvertX()

Adjust the horizontal axis so values descend from left to right

public void InvertX()

InvertY()

Adjust the vertical axis so values descend from bottom to top

public void InvertY()

Add a link to another plot's axis so its limits update when limits of an axis from this plot changes

public void Link(IAxis thisPlotAxis, IAxis otherPlotAxis, Plot otherPlot)

Parameters

thisPlotAxis IAxis
otherPlotAxis IAxis
otherPlot Plot

Add a link to the target plot control so its axis limits update when this plot's axis limits change

public void Link(IPlotControl target, bool x = true, bool y = true)

Parameters

target IPlotControl
x bool
y bool

Add a link to the target plot so its axis limits update when this plot's axis limits change

public void Link(Plot target, bool x = true, bool y = true)

Parameters

target Plot
x bool
y bool

Margins()

Reset plot data margins to their default value.

public void Margins()

Margins(double, double)

Define the amount of whitespace to place around the data area when calling AutoScale(). Values are a fraction from 0 (tightly fit the data) to 1 (lots of whitespace).

public void Margins(double horizontal = 0.1, double vertical = 0.15)

Parameters

horizontal double
vertical double

Margins(double, double, double, double)

Define the amount of whitespace to place around the data area when calling AutoScale(). Values are a fraction from 0 (tightly fit the data) to 1 (lots of whitespace).

public void Margins(double left = 0.05, double right = 0.05, double bottom = 0.07, double top = 0.07)

Parameters

left double
right double
bottom double
top double

MarginsX(double)

Define the amount of whitespace to place on the left and right of the data area when calling AutoScale(). Values are a fraction from 0 (tightly fit the data) to 1 (lots of whitespace).

public void MarginsX(double horizontal = 0.1)

Parameters

horizontal double

MarginsY(double)

Define the amount of whitespace to place on the bottom and top of the data area when calling AutoScale(). Values are a fraction from 0 (tightly fit the data) to 1 (lots of whitespace).

public void MarginsY(double vertical = 0.15)

Parameters

vertical double

NumericTicksBottom()

Remove all bottom axes, create a numeric bottom axis, add it to the plot, and return it.

public BottomAxis NumericTicksBottom()

Returns

BottomAxis

Pan(CoordinateOffset)

Adjust limits all axes to pan by the given distance in coordinate space

public void Pan(CoordinateOffset distance)

Parameters

distance CoordinateOffset

Pan(Pixel, Pixel)

Adjust limits all axes to pan the pixel distance between two points

public void Pan(Pixel mouseDown, Pixel mouseUp)

Parameters

mouseDown Pixel
mouseUp Pixel

Pan(PixelOffset)

Adjust limits all axes to pan given pixel distance

public void Pan(PixelOffset offset)

Parameters

offset PixelOffset

RectifyX()

Adjust the horizontal axis so values ascend from left to right

public void RectifyX()

RectifyY()

Adjust the vertical axis so values ascend from bottom to top

public void RectifyY()

Remove(Edge)

Remove all axes that lie on the given edge.

public void Remove(Edge edge)

Parameters

edge Edge

Remove(IAxis)

Remove the given axis from the plot

public void Remove(IAxis axis)

Parameters

axis IAxis

Remove(IPanel)

Remove the given Panel

public void Remove(IPanel panel)

Parameters

panel IPanel

ReplaceNullAxesWithDefaults()

Adds the default X and Y axes to all plottables with unset axes

public void ReplaceNullAxesWithDefaults()

SetLimits(AxisLimits)

public void SetLimits(AxisLimits limits)

Parameters

limits AxisLimits

SetLimits(AxisLimits, IXAxis, IYAxis)

public void SetLimits(AxisLimits limits, IXAxis xAxis, IYAxis yAxis)

Parameters

limits AxisLimits
xAxis IXAxis
yAxis IYAxis

SetLimits(CoordinateRange, CoordinateRange)

public void SetLimits(CoordinateRange xRange, CoordinateRange yRange)

Parameters

xRange CoordinateRange
yRange CoordinateRange

SetLimits(CoordinateRect)

public void SetLimits(CoordinateRect rect)

Parameters

rect CoordinateRect

SetLimits(double, double, double, double)

public void SetLimits(double left, double right, double bottom, double top)

Parameters

left double
right double
bottom double
top double

SetLimits(double, double, double, double, IXAxis, IYAxis)

public void SetLimits(double left, double right, double bottom, double top, IXAxis xAxis, IYAxis yAxis)

Parameters

left double
right double
bottom double
top double
xAxis IXAxis
yAxis IYAxis

SetLimits(double?, double?, double?, double?)

public void SetLimits(double? left = null, double? right = null, double? bottom = null, double? top = null)

Parameters

left double?
right double?
bottom double?
top double?

SetLimitsX(AxisLimits)

public void SetLimitsX(AxisLimits limits)

Parameters

limits AxisLimits

SetLimitsX(AxisLimits, IXAxis)

public void SetLimitsX(AxisLimits limits, IXAxis xAxis)

Parameters

limits AxisLimits
xAxis IXAxis

SetLimitsX(CoordinateRect)

public void SetLimitsX(CoordinateRect limits)

Parameters

limits CoordinateRect

SetLimitsX(double, double)

public void SetLimitsX(double left, double right)

Parameters

left double
right double

SetLimitsX(double, double, IXAxis)

public void SetLimitsX(double left, double right, IXAxis xAxis)

Parameters

left double
right double
xAxis IXAxis

SetLimitsY(AxisLimits)

public void SetLimitsY(AxisLimits limits)

Parameters

limits AxisLimits

SetLimitsY(AxisLimits, IYAxis)

public void SetLimitsY(AxisLimits limits, IYAxis yAxis)

Parameters

limits AxisLimits
yAxis IYAxis

SetLimitsY(CoordinateRect)

public void SetLimitsY(CoordinateRect limits)

Parameters

limits CoordinateRect

SetLimitsY(double, double)

public void SetLimitsY(double bottom, double top)

Parameters

bottom double
top double

SetLimitsY(double, double, IYAxis)

public void SetLimitsY(double bottom, double top, IYAxis yAxis)

Parameters

bottom double
top double
yAxis IYAxis

SetupMultiplierNotation(IAxis)

public TickModifierLabel SetupMultiplierNotation(IAxis axis)

Parameters

axis IAxis

Returns

TickModifierLabel

SquareUnits()

Force pixels to have a 1:1 scale ratio. This allows circles to always appear as circles and not stretched ellipses.

public void SquareUnits()

SquareUnits(bool)

If true, force pixels to have a 1:1 scale ratio. This allows circles to always appear as circles and not stretched ellipses. If false, disable axis rules related to square units and restore default behavior.

public void SquareUnits(bool enable)

Parameters

enable bool

TightMargins()

Auto-scale to tightly fit the data so there is no spacing between data points and the edge of the data area

public void TightMargins()

Remove all linked axes rules involving the given axis

public void Unlink(IAxis axis)

Parameters

axis IAxis

Remove all linked axes rules involving the target plot control

public void Unlink(IPlotControl target)

Parameters

target IPlotControl

Remove all linked axes rules involving the target plot

public void Unlink(Plot target)

Parameters

target Plot

UnlinkAll()

Remove all linked axes rules

public void UnlinkAll()

Zoom(Pixel, Pixel)

Modify zoom for all axes as if the mouse were right-clicked and dragged

public void Zoom(Pixel px1, Pixel px2)

Parameters

px1 Pixel
px2 Pixel

Zoom(Pixel, double, double)

public void Zoom(Pixel px, double fracX, double fracY)

Parameters

px Pixel
fracX double
fracY double

Zoom(double, double)

public void Zoom(double fracX = 1, double fracY = 1)

Parameters

fracX double
fracY double

ZoomIn(double, double)

public void ZoomIn(double fracX = 1, double fracY = 1)

Parameters

fracX double
fracY double

ZoomOut(double, double)

Zoom out so the new view is the given fraction of the original view

public void ZoomOut(double x = 1, double y = 1)

Parameters

x double
y double

ZoomOutX(double)

Zoom out so the new view is the given fraction of the original view

public void ZoomOutX(double x = 1)

Parameters

x double

ZoomOutY(double)

Zoom out so the new view is the given fraction of the original view

public void ZoomOutY(double y = 1)

Parameters

y double