MultipleXYPlot STATBEAN®

 

Purpose: Displays a scatterplot or lineplot for two or more sets of numeric columns. Makes Statgraphics function as a multiple XY scatter plot maker to plot multiple graphics for two or more sets of data.

Multiple XY Scatter Plot Maker DataSource: any. 

multiplexyplotexample


Read/Write Properties To Plot Multiple Graphs
Name Type Description Possible Values Default Value
connected boolean[] Whether the points should be connected with a line. true,false false
forceEqualScales boolean Whether to force the x-axis and y-axis scaling to be the same. true,false false
points boolean[] Whether point symbols should be plotted. true,false true
showLegends boolean Whether to display legends at the right of the plot. true,false true
suppressXaxis boolean Whether to suppress display of the x-axis scaling and ticmarks. true,false false
suppressYaxis boolean Whether to suppress display of the y-axis scaling and ticmarks. true,false false
tablewiseExclusion boolean Whether all rows of the data table containing a missing value in any column should be excluded from the plot. true,false false
xVariableNames String[] The name of one or more columns with data values to be plotted on the horizontal axis. Any string.  
yVariableNames String[] The name of one or more columns with data values to be plotted on the vertical axis. Any string.  
Other properties are inherited from the java.awt.Canvas class and from the general GraphicalStatbean class. 

Multiple XY Scatter Plot Maker 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 
XYPlot xYPlot1 = new STATBEANS.XYPlot(); 

//set the columns for the x and y axes 
String xnames[]=new String[1]; 
xnames[0]="weight"; 
String ynames[]=new String[2]; 
ynames[0]="mpg"; 
ynames[1]="displace"; 
xYPlot1.setXVariableNames(xnames); 
xYPlot1.setYVariableNames(ynames); 

//set the point types and color 
String ptype[]={"triangle","square"}; 
xYPlot1.setPointTypes(ptype); 
Color pcolor[]={Color.blue,Color.green}; 
xYPlot1.setPointColors(pcolor); 

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

//override the xaxis title 
xYPlot1.setXaxisTitle("weight in pounds"); 

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

//add the plot to the application frame 
add(xYPlot1); 

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

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