Home > Sample Charts > CloudChart > A Simple Scatter plot in XYZ space

A Simple Scatter plot in XYZ space

The Cloud chart is essentially a scatter-plot in 3 dimensions (maybe you are running an experiment in which you vary pressure and temperature, and are interested in the yield of the result). Rather than fitting a line to show the relationship between input and output, you fit a plane (if the data is linear in both x and y) or a curved surface.

This style of chart would often be used with a large dataset (several thousand points) to get a feel for the general shape of a distribution. In this example ‘risers’ have been drawn from the xy plane to give a better idea of where the points are placed on the xy plane.


SharpPlot sp = new SharpPlot;

sp.SetMargins(24,32,18,6);
sp.Heading = "XYZ Scatter";
sp.HeadingStyle = HeadingStyles.Right;

zdata = new int[] {12,65,77,117,9,112};
xdata = new int[] {17,31,29,21,30,21};
ydata = new int[] {190,270,310,300,190,230};

sp.CloudChartStyle = CloudChartStyles.WallShading|CloudChartStyles.Risers|
         CloudChartStyles.HaloMarkers;
sp.ZAxisStyle = ZAxisStyles.ForceZero;
sp.XAxisStyle = XAxisStyles.GridLines;
sp.YAxisStyle = YAxisStyles.GridLines|YAxisStyles.FlatText;
sp.SetZTickMarks(50);
sp.SetYTickMarks(20);
sp.SetMarkerScales(2);
sp.SetMarkers(Marker.Ball);

sp.DrawCloudChart(xdata,ydata,zdata);

Worked Examples

cloudchart1 cloudchart2 cloudchart3 cloudchart4

Send comments on this topic
© Dyalog Ltd 2013