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 ...

Start Free Trial

No credit card required