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
AutoScaler
Logic that determines padding around the data area when AutoScale() is called
public IAutoScaler AutoScaler { get; set; }
Property Value
Bottom
The primary horizontal axis below the plot
public IXAxis Bottom { get; }
Property Value
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
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
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
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
Left
The primary vertical axis to the left of the plot
public IYAxis Left { get; }
Property Value
LimitsHaveBeenSet
Indicates whether the axis limits have been set (manually or by autoscale)
public bool LimitsHaveBeenSet { get; }
Property Value
Right
The primary vertical axis to the right of the plot
public IYAxis Right { get; }
Property Value
Rules
Rules that are applied before each render
public List<IAxisRule> Rules { get; }
Property Value
Title
A special panel
public TitlePanel Title { get; }
Property Value
Top
The primary horizontal axis above the plot
public IXAxis Top { get; }
Property Value
Methods
AddBottomAxis()
Crete a new axis, add it to the plot, and return it
public BottomAxis AddBottomAxis()
Returns
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
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
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
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
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
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
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
DateTimeTicksBottom()
Remove all bottom axes, create a DateTime bottom axis, add it to the plot, and return it.
public DateTimeXAxis DateTimeTicksBottom()
Returns
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
GetAxes(Edge)
All axes with the given edge
public IEnumerable<IAxis> GetAxes(Edge edge)
Parameters
edge
Edge
Returns
GetDataLimits()
Return the 2D axis limits of data for all plottables using the default axes
public AxisLimits GetDataLimits()
Returns
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
Returns
GetLimits()
Return the 2D axis limits for the default axes
public AxisLimits GetLimits()
Returns
GetLimits(IAxes)
Return the 2D axis limits for the given X/Y axis pair
public AxisLimits GetLimits(IAxes axes)
Parameters
axes
IAxes
Returns
GetLimits(IXAxis, IYAxis)
Return the 2D axis limits for the given X/Y axis pair
public AxisLimits GetLimits(IXAxis xAxis, IYAxis yAxis)
Parameters
Returns
GetPanels()
Returns all axes, panels, and the title
public IPanel[] GetPanels()
Returns
- IPanel[]
GetXAxes()
All X axes
public IEnumerable<IXAxis> GetXAxes()
Returns
GetYAxes()
All Y axes
public IEnumerable<IYAxis> GetYAxes()
Returns
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()
Link(IAxis, IAxis, Plot)
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
Link(IPlotControl, bool, bool)
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
IPlotControlx
booly
bool
Link(Plot, bool, 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
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
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
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
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
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
AxisLimitsxAxis
IXAxisyAxis
IYAxis
SetLimits(CoordinateRange, CoordinateRange)
public void SetLimits(CoordinateRange xRange, CoordinateRange yRange)
Parameters
xRange
CoordinateRangeyRange
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
SetLimits(double, double, double, double, IXAxis, IYAxis)
public void SetLimits(double left, double right, double bottom, double top, IXAxis xAxis, IYAxis yAxis)
Parameters
SetLimits(double?, double?, double?, double?)
public void SetLimits(double? left = null, double? right = null, double? bottom = null, double? top = null)
Parameters
SetLimitsX(AxisLimits)
public void SetLimitsX(AxisLimits limits)
Parameters
limits
AxisLimits
SetLimitsX(AxisLimits, IXAxis)
public void SetLimitsX(AxisLimits limits, IXAxis xAxis)
Parameters
limits
AxisLimitsxAxis
IXAxis
SetLimitsX(CoordinateRect)
public void SetLimitsX(CoordinateRect limits)
Parameters
limits
CoordinateRect
SetLimitsX(double, double)
public void SetLimitsX(double left, double right)
Parameters
SetLimitsX(double, double, IXAxis)
public void SetLimitsX(double left, double right, IXAxis xAxis)
Parameters
SetLimitsY(AxisLimits)
public void SetLimitsY(AxisLimits limits)
Parameters
limits
AxisLimits
SetLimitsY(AxisLimits, IYAxis)
public void SetLimitsY(AxisLimits limits, IYAxis yAxis)
Parameters
limits
AxisLimitsyAxis
IYAxis
SetLimitsY(CoordinateRect)
public void SetLimitsY(CoordinateRect limits)
Parameters
limits
CoordinateRect
SetLimitsY(double, double)
public void SetLimitsY(double bottom, double top)
Parameters
SetLimitsY(double, double, IYAxis)
public void SetLimitsY(double bottom, double top, IYAxis yAxis)
Parameters
SetupMultiplierNotation(IAxis)
public TickModifierLabel SetupMultiplierNotation(IAxis axis)
Parameters
axis
IAxis
Returns
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()
Unlink(IAxis)
Remove all linked axes rules involving the given axis
public void Unlink(IAxis axis)
Parameters
axis
IAxis
Unlink(IPlotControl)
Remove all linked axes rules involving the target plot control
public void Unlink(IPlotControl target)
Parameters
target
IPlotControl
Unlink(Plot)
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
Zoom(Pixel, double, double)
public void Zoom(Pixel px, double fracX, double fracY)
Parameters
Zoom(double, double)
public void Zoom(double fracX = 1, double fracY = 1)
Parameters
ZoomIn(double, double)
public void ZoomIn(double fracX = 1, double fracY = 1)
Parameters
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
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