3.3.8 3D Surface Plot

Version Info

Minimum Origin Version Required: Origin8 SR0

Example

The following function shows how to plot Color Map Suface from matrix window.

void surface_plot()
{
	// open matrix 
	string strFile = GetAppPath(true) + "Samples\\Matrix Conversion and Gridding\\2D Gaussian.ogm";
	if( !strFile.IsFile() )
	{
		printf("%s file not existed\n", strFile);
		return;
	}	
	MatrixLayer ml;
	ml.Open(strFile);
	MatrixObject mo = ml.MatrixObjects(0);
	
	// plotting
	GraphPage gp;
	gp.Create("CMAP"); // create graph page with template
	GraphLayer gl = gp.Layers(0);
	int nn = gl.AddPlot(mo, IDM_PLOT_SURFACE_COLORMAP);
	if(0 == nn)
	{
		gl.Rescale();
		printf("3D Surface plotted successfully\n");
	}
}