StatBean Name: ScatterplotMatrix

Purpose: - displays a matrix of 2-variable scatterplots for several numeric columns.

DataSource: Any.


Read/Write Properties
NameTypeDescriptionPossible ValuesDefault Value
columnNamesString arrayThe names of the columns to be plotted.One or more strings.{""}
gapdoubleThe proportion of the plotting space left blank around each side of the cells of the plot.0.0-0.250.1
labelColorColorThe color of the variable labels.Any valid Color.Color.black
labelFontFontThe font to be used for the variable labels.Any Font."Serif",0,12
missingValueExclusionStringThe method for handling records which contain missing values."Columnwise","Casewise",
"Tablewise"
"Columnwise"
smootherColorColorColor for drawing the smooth.Any valid color.Color.blue
smootherPercentageintWidth of the smoother as a percentage of the number of observations.1-9950
smootherTypeStringType of smoother, if any, to be added to the plot."None",
"Running Means",
"Running Lines",
"LOWESS",
"Robust LOWESS"
"None"

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");

//create a plot bean
ScatterplotMatrix scatterplotMatrix1 = new STATBEANS.ScatterplotMatrix();

//set the columns names
String[] temp = new String[4];
temp[0] = "mpg";
temp[1] = "horsepower";
temp[2] = "displace";
temp[3] = "weight";
scatterplotMatrix1.setColumnNames(temp);

//set smoother type
scatterplotMatrix1.setSmootherType("Robust Lowess");

//add plot
add(scatterplotMatrix1);

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

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