Scatter plot matrix
Scatter plot matrix is a set of scatter plots. These are constructed by considering each possible pair of attributes and plotting points using just those two attributes as a scatter plot. This will result in n times n scatter plots if n is the number of attributes. It is most convenient to arrange these plots into a rectangular matrix (hence the name).
We looked into this kind of plot earlier when we were discussing the Breeze library and its plotting framework. However, it is informative to see how this could be done in pure JFreeChart. It will also make use of most of the JFreeChart concepts that we have discussed so far:
import scala.collection.mutable.{MutableList, Map} import scala.math._ import org.jfree.chart._ import org.jfree.data.xy._ import org.jfree.data.statistics._ import java.io.{FileReader, BufferedReader} import java.awt.GridLayout import javax.swing.JFrame import javax.swing.Jpanel
Note that we will need to import some Swing stuff as well here. The reason...