Reference > Style examples > Caption written at the end of the Axis

Caption written at the end of the Axis

By default, SharpPlot writes the X-caption below the axis (at the right-hand end) and the Y-axis and Z-axis captions beside the axis aligned to the topmost tickmark. This style may be used to put the caption at the end of the axis instead.


sp.LineGraphStyle = LineGraphStyles.GridLines;
sp.Heading = "Both Axes have Captions at End";
sp.XAxisStyle = XAxisStyles.AtEndCaption;
sp.YAxisStyle = YAxisStyles.AtEndCaption;
sp.YCaption = "Up\nhere";
sp.XCaption = "Over\nthere";
sp.DrawLineGraph(col_S4,col_S2);

This works best with short (or multi-line) captions. The Y-caption will be wrapped into a width equal to twice the left margin.


Send comments on this topic
© Dyalog Ltd 2013