Data Plots¶
The data plotting features supported by mapdata provide univariate, bivariate, and multivariate visualizations of data that can reveal features and relationships that are not easily discerned by viewing just the map or the data table.
Most of the types of plots that can be produced with mapdata can be created using a single dialog, via the Plot/General menu item. Other more specialized plot types are listed on the Plot menu itself.
Each of the menu options is briefly described below. Pages linked to from these descriptions, and from the menu to the right, provide more detailed descriptions.
General plots – Creates box plots, scatter plots, line plots, kernel density plots, bubble plots, Q-Q plots, ECDF plots, and other types. Log-transformation and data grouping can be applied to the data for some types of plots. Cloning of this dialog allows different plot types or different data selections to be viewed side by side.
Pair plots – Creates a matrix of plots for two or more numeric variables. Off-diagonal cells of the matrix contain scatter plots for pairs of variables, and diagonal cells of the matrix contain kernel-density plots.
Multi-variable line or scatter plot – Displays a line plot or a scatter plot for a single selected X variable and one or more numeric Y variables.
Multi-variable grouped bar chart – Displays a vertically-stacked set of bar charts for multiple numeric variables and one categorical variable, showing either one bar chart for each variable or one bar chart for each category.
Grouped percentage bar chart – Displays a set of horizontal bars for a set of numeric variables and one categorical variable, showing the percent of the total either for each variable or for each category.
Variable distribution plot – Creates a box plot, kernel density plot, stripchart, or violin plot showing the distribution of one or more numeric variables. The ‘General’ plot dialog also allows these types of plots to be made, but for subgroups of only a single variable.
Percent stacked area plot – Creates a stacked area plot for two or more numeric values, illustrating the relative proportions (percentages) over a range of dates or category values.
Rank abundance plot – Creates a rank abundance plot for the visualization of species abundance data, or potentially other compatible data types.
Several of the statistical analyses also produce graphic output such as scatter plots and heatmaps.
The Graphical Plot Index contains a visual inventory of all of the types of plots that mapdata can produce.
Working With Data Plots¶
Selecting Data for Plotting¶
By default, all data in the data table will be used for a plot. If the “Selected data only” checkbox on the plot dialog is checked, only the data points that are highlighted in the table will be used for plotting.
By default, plots are updated automatically with any changes made to data selections in the table or map. If the “Auto-update” checkbox is un-checked, a plot of selected data only will no longer be updated when changes are made to selections on the map and table.
Missing data are not included on any plots. The Table/Data types menu option can be used to view the number of missing values for each column of the data table.
Transforming Data Used for Plotting¶
The checkboxes to the right of the X and Y variable selectors on the general plotting dialog will transform the data by calculating the base-10 logarithm of the data values; the transformed values will be used for plotting instead of the original values. If the logarithm cannot be computed for any X or Y value, the corresponding checkbox will be disabled and the un-transformed data will be used. Logarithms cannot be computed for non-positive numbers and for date and date/time variables.
Viewing Data Used for Plotting¶
At the bottom of every plot dialog is a button labeled “Source Data” that, when clicked, will display all of the from the main data table that are used for the plot. Missing values are ordinarily removed from the source data display, and log-transformations applied if specified. Some plot dialogs also have a button labeled “Plot Data” that will display the same data in another form, if the plot is based on a substantial rearrangement of the source data. For example, for box plots, the “Plot Data” button will display a table showing all of the data values in each of the chosen categories.
The Ctrl-S keystroke will allow the data in the “Source Data” and “Plot Data” displays to be saved to a file.
Adding and Modifying the Plot Title and Axis Labels¶
The following keyboard shortcuts (hotkeys) can be used to modify the plot title and axis labels:
Alt-T – Add or change the title.
Alt-X – Change the label on the X axis.
Alt-Y – Change the label on the Y axis.
Hotkeys for Customizing Specific Plot Types¶
Some types of plots can be customized by changing the opacity of lines or symbols or by adding additional information to the plots. These customizations are carried out using keystroke commands (hotkeys). The keystroke commands should be used when a plot window has the focus.
The hotkeys that can be used to customize plots are:
Alt-A – Change the opacity (alpha value) of symbols on bubble plots, scatter plots, line plots, stripcharts, and kernel density plots.
Alt-B – For histograms and binned min-max plots: change the number of bins used. For scatter plots: toggle on or off the display of vertical and horizontal lines delineating the Jenks Natural Breaks in X and Y variables, respectively. For line plots: toggle on or off the display of vertical lines delineating the Jenks Natural Breaks in the X variable.
Alt-F – Flips the Y axis values on min-max plots; bar plots of counts, totals, and means; bubble plots; scatter plots; and Y-range plots. The Y axis on bar plots can only be flipped when the categories have been rotated to be on the Y axis.
Alt-G – Toggle the coloring of points on the Normal Q-Q plot to correspond to groups defined by the Jenks Natural Breaks method.
Alt-L – Toggle the display of a LOESS smoothing line on line plots and scatter plots. Toggle the display of correlation coefficient labels on a correlation matrix and similarity matrix (heatmap).
Alt-R – For line plots and scatter plots: toggle the display of an ordinary least-squares linear regression line. For box plots; bar plots of counts, totals, and means; min-max plots; stripcharts; and violin plots: rotate the X and Y axes.
Alt-S – For scatter plots, toggle the display of a Theil-Sen line.
Alt-T – Add or change the plot title.
Alt-X – Add or change the X-axis label.
Alt-Y – Add or change the Y-axis label. For pair plots, rotate the Y-axis label.
The Help/Hotkeys menu item will display the use of these and other hotkeys.
Additional plot customization can be carried out by modifying settings using the plot configuration dialog.
Modifying the Range of X and Y Values Displayed¶
There are two ways to control the range of X and Y values that are displayed on a plot.
The first way is to select only the data that falls within the desired range(s) and then use only the selected data for the plot. The Selections/Set by query dialog is an efficient way of selecting data by range.
The second way is to use the ‘zoom’ control on the control bar that is at the bottom of the plot window (i.e., the magnifying glass). After this contol is selected by clicking on it, clicking and dragging a rectangle on the plot will zoom the plot to the selected range of data.
Configuring Data Plots¶
The Plot/Settings menu option opens a dialog that allows configuration of several aspects of plot appearance and operation.
The plot configuration dialog prompts for customization of the following settings:
Display a dialog showing the R2 value when a scatter plot is drawn. This display provides quick feedback when changing data selections or data transformations. More regression diagnostics can be seen on the Bivariate Statistics dialog.
Text wrapping width for plot tick labels. Some plots (e.g., stripcharts) will wrap long labels for values on the X axis. This setting changes the width at which labels are wrapped.
Wrap labels at underscores. This setting will cause underscores to be replaced with spaces in tick labels, and the labels may then be wrapped at the former positions of the underscores.