The GridPlot command can be used to look for patterns in higher dimensional datasets. In the following example, the columns of a sample data set are plotted against one another in order to look for possible correlation between the columns.
Global plot options can be passed to all plots in the grid using plotoptions:
The Iris dataset contains measurements in centimeters for several properties of 150 flowers from 3 species of iris. In the following example, the GridPlot command is used to look for patterns between the properties of the flowers.
In the following, the Iris data is imported into a DataFrame.
Since the data is stored in a DataFrame, the GridPlot command can automatically determine the labels for the diagonal of the grid from the column names. The upper and lower options control the types of plots to show on the upper triangle and lower triangle of the matrix respectively. The width option is passed to the DocumentTools:-Tabulate command, and controls the size of the resulting grid of plots.
Note that global plot options set by the plotoptions option can be locally overridden by specifying plot options in the upper, lower or diagonal arguments.
Additional options such as width and fillcolor are passed to the DocumentTools:-Tabulate command. This means that custom coloring can be applied to the cells of the grid of plots. In the following example, a custom coloring scheme is first created for the upper triangle of plots and passed to the plots:-pointplot command. Next, a custom coloring scheme is applied to the empty lower triangle of the grid that corresponds to a HeatMap for the CorrelationMatrix of the Iris dataset.
From using the custom coloring scheme, it can be observed that the cell in the 4th row and 3rd column shows the darkest color. The coloring used colors from white to black to indicate correlation values from 0 to 1, meaning that in this case, there is a higher level of correlation between the Pedal Length and Pedal Width variables.
The correlation option is useful for showing more details on correlation between columns of data and in order to generate corrgrams for multivariate data. For example, if the values from the correlation matrix are used for the lower triangle, the following plot can be generated: