StatBean Name: XYZPlot

Purpose: Displays a scatterplot or lineplot for three numeric columns.

DataSource: any.


Read/Write Properties
NameTypeDescriptionPossible ValuesDefault Value
connectedbooleanWhether the points should be connected with a line.true,falsefalse
forceEqualScalesbooleanWhether to force the x-axis and y-axis scaling to be the same.true,falsefalse
horizontalViewAngleintAngle from which plot is viewed in degrees.Any integer.20
pointsbooleanWhether point symbols should be plotted.true,falsetrue
threeDReferenceLineStringType of reference lines, if any, to be added to the plot."None",
"Bottom",
"Top",
"Front",
"Back",
"Left",
"Right"
"None"
threeDReferenceLineColorColorColor for drawing the reference line.Any valid color.Color.black
suppressXaxisbooleanWhether to suppress display of the x-axis scaling and ticmarks.true,falsefalse
suppressYaxisbooleanWhether to suppress display of the y-axis scaling and ticmarks.true,falsefalse
suppressZaxisbooleanWhether to suppress display of the z-axis scaling and ticmarks.true,falsefalse
tablewiseExclusionbooleanWhether all rows of the data table containing a missing value in any column should be excluded from the plot.true,falsefalse
verticalViewAngleintAngle from which plot is viewed in degrees.Any integer.20
xVariableNameStringThe name of the column with data values to be plotted on the X axis.Any string."X"
yVariableNameStringThe name of the column with data values to be plotted on the Y axis.Any string."Y"
zVariableNameStringThe name of the column with data values to be plotted on the Z axis.Any string."Z"

Other properties are inherited from the java.awt.Canvas class and from the general GraphicalStatbean class.

Code Sample

//create a datasource bean
FileDataSource fileDataSource1 = new STATBEANS.FileDataSource();

//set the file name to be read
fileDataSource1.setFileName("c:\\statbeans\\samples\\cardata.txt");

//set the delimiter character used in the file
fileDataSource1.setDelimiter("tab");

//create a plot bean
XYZPlot xYZPlot1 = new STATBEANS.XYZPlot();

//set the columns for the x and y axes
xYZPlot1.setZVariableName("mpg");
xYZPlot1.setXVariableName("weight");
xYZPlot1.setYVariableName("horsepower");

//add reference lines
xYZPlot1.setThreeDReferenceLine("Bottom");

//override the top title
xYZPlot1.setTopTitleLine1("Plot of Automobile Data");

//turn on point identifcation
xYZPlot1.setHighlightPointOnMouseClick(true);
xYZPlot1.setShowPointClickedMessage(true);

//make the plot a listener for changes in the FileDataSource bean
fileDataSource1.addDataChangeListener(xYZPlot1.listenerForDataChange);

//instruct the fileDataSource bean to read the file
fileDataSource1.readData();