Table of Contents

Class PolarAxis

Namespace
ScottPlot.Plottables
Assembly
ScottPlot.dll

A polar axes uses spoke lines and circles to describe a polar coordinate system where points are represented by a radius and angle. This class draws a polar axes and has options to customize spokes and circles.

public class PolarAxis : IPlottable, IManagesAxisLimits
Inheritance
PolarAxis
Implements
Inherited Members
Extension Methods

Properties

Axes

This object performs coordinate/pixel translation at render time based on the latest data area. It stores the axes to use for this plottable and also the data area (in pixels) updated just before each render. If this object is null it will be constructed using the default X and Y axes at render time.

public IAxes Axes { get; set; }

Property Value

IAxes

Circles

Radial positions describing concentric circles centered on the origin

public List<PolarAxisCircle> Circles { get; }

Property Value

List<PolarAxisCircle>

IsVisible

Toggles whether this plottable is shown and contributes to the automatic axis limit detection. The calling method will check this variable (it does not need to be checked inside the Render method).

public bool IsVisible { get; set; }

Property Value

bool

LegendItems

Items which will appear in the legend

public IEnumerable<LegendItem> LegendItems { get; }

Property Value

IEnumerable<LegendItem>

ManageAxisLimits

Enable this to modify the axis limits at render time to achieve "square axes" where the units/px values are equal for horizontal and vertical axes, allowing circles to always appear as circles instead of ellipses.

public bool ManageAxisLimits { get; set; }

Property Value

bool

Rotation

Rotates the axis clockwise from its default position (where 0 points right)

public Angle Rotation { get; set; }

Property Value

Angle

Spokes

Spokes are straight lines that extend outward from the origin

public List<PolarAxisSpoke> Spokes { get; }

Property Value

List<PolarAxisSpoke>

StraightLines

If enabled, radial ticks will be drawn using straight lines connecting intersections circles and spokes

public bool StraightLines { get; set; }

Property Value

bool

Methods

GetAxisLimits()

Return the 2D area (in coordinate space) occupied by the data contained in this plottable

public AxisLimits GetAxisLimits()

Returns

AxisLimits

GetCoordinates(PolarCoordinates)

Return the X/Y position of a point defined in polar space

public Coordinates GetCoordinates(PolarCoordinates point)

Parameters

point PolarCoordinates

Returns

Coordinates

GetCoordinates(IReadOnlyList<double>, bool)

Return coordinates for the given radius values assuming one value per spoke.

public Coordinates[] GetCoordinates(IReadOnlyList<double> values, bool clockwise = false)

Parameters

values IReadOnlyList<double>
clockwise bool

Returns

Coordinates[]

GetCoordinates(double, Angle)

Return the X/Y position of a point defined in polar space

public Coordinates GetCoordinates(double radius, Angle angle)

Parameters

radius double
angle Angle

Returns

Coordinates

GetCoordinates(double, double)

Return the X/Y position of a point defined in polar space

public Coordinates GetCoordinates(double radius, double degrees)

Parameters

radius double
degrees double

Returns

Coordinates

RegenerateCircles(int)

[Obsolete("use SetCircles()", true)]
public void RegenerateCircles(int count = 3)

Parameters

count int

RegenerateSpokes(int)

[Obsolete("use SetSpokes()", true)]
public void RegenerateSpokes(int count = 5)

Parameters

count int

RegenerateSpokes(string[])

[Obsolete("use SetSpokes()", true)]
public void RegenerateSpokes(string[] labels)

Parameters

labels string[]

Render(RenderPack)

Draw the data from this plottable into the data area defined in the Axes. By default the surface is already clipped to the data area, but this can be cleared inside the plottable.

public virtual void Render(RenderPack rp)

Parameters

rp RenderPack

SetCircles(double, int)

Create count ticks (circles) evenly spaced between 0 and maximumRadius

public void SetCircles(double maximumRadius, int count)

Parameters

maximumRadius double
count int

SetCircles(double[])

Clear existing circles and add new ones at the defined positions.

public void SetCircles(double[] positions)

Parameters

positions double[]

SetCircles(double[], string[])

Clear existing circles and add new ones at the defined positions with the given labels.

public void SetCircles(double[] positions, string[] labels)

Parameters

positions double[]
labels string[]

SetSpokes(Angle[], double, string[])

Replace existing spokes with new ones placed at the specified angles

public void SetSpokes(Angle[] angles, double length, string[] labels)

Parameters

angles Angle[]
length double
labels string[]

SetSpokes(int, double, bool)

Replace existing spokes with a new set evenly spaced around the circle.

public void SetSpokes(int count, double length, bool degreeLabels = true)

Parameters

count int
length double
degreeLabels bool

SetSpokes(string[], double, bool)

Replace existing spokes with new ones that have the given labels evenly spaced around the circle

public void SetSpokes(string[] labels, double length, bool clockwise = true)

Parameters

labels string[]
length double
clockwise bool

UpdateAxisLimits(Plot)

public virtual void UpdateAxisLimits(Plot plot)

Parameters

plot Plot