Skip to main content

Table 1 Components of basic grammar of graphics

From: ggbio: an R package for extending the grammar of graphics for genomic data

Comp

Explanation

Figure 8 usage

Figure 1 usage

Data

Data to visualize, containing variables and values

A gene expression table

A GRanges object (core data structure in Bioconductor)

Geom

A geometric object draws the data as a graphical primitive. Types ofprimitives include points, lines, polygons or text. Some statistical orcomposite primitives, such as histogram, boxplot and point range, areconsidered to be geoms

Points with color indicating significance of expression (red =significant, black = not)

Alignments (new), Chevron (new)

Stat

A statistical transformation transforms, filters and/or summarizes avariable prior to plotting. For example, binning and counting isnecessary to make a histogram. The default would be an identitytransformation, which does not change the data. In ggplot2 an appropriatedefault transformation is chosen according to the geom, for example, thebin transform for the histogram geom. Thus, the user rarely needs toexplicitly specify one

Identity (computation of M value and A values is done outside of thegrammar)

Steppings (new)

Scales

A scale maps the variables (for example, expression, treatment, gene id)from data space to aesthetics (for example, position, color, area).Scales also control associated guides like axes and legends. Included inscales are numerical transformations such as log or square root ofvariables, so that an axis can be drawn on a log scale, for example. Thedefault is a linear scale

A, the log geometric average, the x axis, and M, the log ratio mapped tothe y axis

Genomic position mapped to position along x axis, and levels mapped to yaxis

Coord

A coordinate system controls how two position scales work together. Thedefault is the Cartesian coordinate system, but others such as a polarcoordinate system could be chosen

Cartesian

Cartesian

Facet

A faceting specification is used to produce small multiples [42] for subsets of the data. In other graphical systems it isknown as latticing [43], trellising [44] or even conditioning

None

None

Layout (new)

A layout is a new grammatical component for controlling how multipleplots are arranged in a figure. It was motivated by the need to displaymultiple genomic annotation data sets simultaneously, and also supportsgenomic overviews

Single

Linear

  1. Components of the basic grammar of graphics, and the extended grammar, and howthey are used in Figures 8 and 1. Figure 9 illustrates how the grammar has beenextended for biological data. Entries marked with 'new' are those developed aspart of this work; the rest are inherited from ggplot2.