SharpPlot.YCaption Property

Set Y caption. The Y-axis caption is written by default vertically alongside the axis.

public string YCaption {get; set;}

Example

sp.YCaption = "Tonnes";

It may also be placed at the top of the axis:

sp.YAxisStyle = YAxisStyles.AtEnd;

This is a better placement for short captions such as ‘mm’ or ‘kg’. Captions written at the top of the axis will be split into multiple lines if you include ‘\n’ in the text, for example ‘Height\n(cm)’ will give a two-line caption. The Caption style controls the alignment of the text for captions placed ‘atend’.

For centred ‘atend’ captions the centred text is wrapped into an effective width of twice the appropriate margin, and left or right aligned text is wrapped into the margin width.

See also ...

SharpPlot Members | CaptionStyle Property | YCaptionFormat Property