////////////////////////////////////////////////////////////////////////////////
// Filename:    Plot3D.ogs
// Creation:    1/19/99
// Purpose:     To generate plots from the menu or from the 3D toolbar
// Modifications:
// JCG 03/13/03 v7.0535 SHOULD_NOT_RUN_INTO_IMAGE_MODE_AFTER_IMAGE_PLOT
////////////////////////////////////////////////////////////////////////////////

[Bar]
	//Plot the selected columns as a 3D bar graph
	worksheet -P 212 Bar3d;
	legend;

[Ribbon]
	//Plot the selected columns as a 3D ribbon graph
	worksheet -P 211 Ribbon;
	legend;

[Walls]
	//Plot the selected columns as a 3D wall graph
	worksheet -P 210 Walls;
	legend;

[Waterfall]
	//Plot the selected columns as a 3D water fall plot
	worksheet -P 210 water3d;
	legend;

[Scatter]
	//Create a 3D scatter plot with the selected Z column
	if (%(%H,@Z#,2) != 1)
	{
		type -b $General.Only1ZColumn;
		break 1;
	}
	worksheet -P 240 3d;

[Trajectory]
	//Create a 3D trajectory plot with the selected Z column
	if (%(%H,@Z#,2) != 1)
	{
		type -b $General.Only1ZColumn;
		break 1;
	};
	worksheet -P 240 Traject;

[ColorFill]
	//Create a 3D color filled surface plot with the selected Z column
	matrix -id;
	worksheet -p 242 mesh;

[XConstant]
	//Create a 3D surface plot with constant slices in X
	matrix -id;
	worksheet -p 242 xconst;

[YConstant]
	//Create a 3D surface plot with constant slices in Y
	matrix -id;
	worksheet -p 242 yconst;

[ColorMap]
	//Create a 3D color map surface plot with the selected Z column
	matrix -id;
	worksheet -p 242 cmap;

[3DBars]
	//Create a 3D bars plot
	matrix -id;
	worksheet -p 242 3Dbars;

[WireFrame]
	//Create a 3D wire frame plot with the selected Z column
	matrix -id;
	worksheet -p 242 wirefrm;

[WireSurface]
	//Create a 3D wire frame plot with semi-transparent nets
	matrix -id;
	worksheet -p 242 wireface;

[ContourColor]
	//Create a 2D color filled contour plot
	matrix -id;
	worksheet -p 226 contour;
	Spectrum;

[ContourBW]
	//Create a 2D black and white contour plot with labels
	matrix -id;
	worksheet -p 226 contline;

[GrayScaleMap]
	#Create a 2D gray scale map
	matrix -id;
	worksheet -p 226 contgray;
	Spectrum;


[ImagePlot]
	matrix -id;// make sure we have gray+data
	/// JCG 03/13/03 v7.0535 SHOULD_NOT_RUN_INTO_IMAGE_MODE_AFTER_IMAGE_PLOT
	//matrix -ii;// make sure we have image
	/// end SHOULD_NOT_RUN_INTO_IMAGE_MODE_AFTER_IMAGE_PLOT
	// check XY mapping and see if reserve
	xreverse=0;
	yreverse=0;
	matrix -pg X v1 v2;
	if(v1 > v2) xreverse = 1;
	matrix -pg Y v1 v2;
	if(v1 > v2) yreverse = 1;
	worksheet -p 220 image;
	set %(1,@D) -tb 3;// turn off plot object level caching to directly draw image
	if(xreverse ==1)
		layer.x.reverse=1;
	// default template y is reverse
	if(yreverse ==1)
		layer.y.reverse=0;
	else
		layer.y.reverse=1;

	del -v xreverse;
	del -v yreverse;

















