StatBean Name: FactorScatterPlot

Purpose: Displays a scatterplot of one numeric variable versus levels of an experimental factor.

DataSource: any.


Read/Write Properties
NameTypeDescriptionPossible ValuesDefault Value
codeVariableNameStringThe name of an optional column with levels of a second factor to define point symbol codes.Any string.""
drawVerticalbooleanWhether to plot the percentages on the vertical axis.true,falsetrue
factorVariableNameStringThe name of the column with factor levels.Any string.""
labelSkipFactorintIf >1, will skip (labelSkipFactor1-1) labels between each label displayed..1+1
rotateClassLabelsbooleanWhether to make the bar labels vertical.true,falsefalse
tablewiseExclusionbooleanWhether all rows of the data table containing a missing value in any column should be excluded from the plot.true,falsefalse
xVariableNameStringThe name of the column with data values to be plotted.Any string.""

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 chart bean
FactorScatterPlot plot1 = new STATBEANS.FactorScatterPlot();
plot1.setBackground(java.awt.Color.yellow);
plot1.setBounds(16,30,380,300);

//set the column to be plotted
plot1.setXVariableName("mpg");

//set the factor column
plot1.setFactorVariableName("origin");

//set the direction
plot1.setDrawVertical(true);

//show the plot
add(plot1);

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

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