g = gramm( Constructor for the class: creates a gramm object with the data to plot
| 'x' | Data plotted as abscissa, or used for histograms/densities. 1D array or cellstr of length N, or for repeated measurements a 1D array of length M, or a matrix/cell with the same size as y | |
| 'y' | Data plotted as ordinate. 1D array of length N, or for repeated measurements a N x M matrix or N x 1 cell of arrays (one curve per row/cell) | |
| 'ymin' | Lower bound of y intervals (absolute), same format as y, see geom_interval() | |
| 'ymax' | Upper bound of y intervals (absolute), same format as y | |
| 'z' | Data plotted along z, same format as y | |
| 'label' | Label text, cellstr of length N, see geom_label() | |
| 'color' | Grouping variable for colors (hue), or continuous color data (see set_continuous_color()) | |
| 'lightness' | Grouping variable for color lightness | |
| 'group' | Grouping variable without visual change (e.g. one line per subject) | |
| 'linestyle' | Grouping variable for line styles | |
| 'size' | Grouping variable for line/point sizes | |
| 'marker' | Grouping variable for point shapes | |
| 'subset' | Logical array of length N selecting the data to plot | |
| 'row' | Grouping variable for rows of subplots, same as facet_grid() | |
| 'column' | Grouping variable for columns of subplots, same as facet_grid() | |
| 'fig' | Grouping variable for separate figures, same as fig() |
More
Example syntax: gramm_object=gramm('x',x_variable,'y',y_variable,'color',color_variable) The data can be given in two layouts:
One row per observation: x, y and the grouping variables are 1D arrays of the same length N (like the columns of a table). Points with the same grouping values form a group, e.g. a line for geom_line() or a summary for stat_summary().
One row per repeated measurement (trajectories, time series...): y is a N x M matrix, or a N x 1 cell of arrays (possibly of different lengths), each row/cell being one curve. x is then a 1D array of length M shared by all curves, or a matrix/cell with the same size as y. The grouping variables still have one value per row (length N), so each curve gets the color, marker... of its row.
Grouping variables (color, lightness, row, column...) represent categories, and can be numerical arrays, cellstr, string, categorical, datetime or duration arrays. Categorical arrays are ordered by their categories, dates and durations chronologically (see set_order_options()). x and y (and ymin, ymax) can also be datetime or duration arrays, which are displayed natively on the axes.
Examples: Broken axis · Custom layouts · Marginal histograms · +28