CVC Workshop: July 2013

Grammar?

The conventional interface to graphics is like a sentence:

Do this to that.
What variables
Make scatterplot height, age.

But different types of graphics are often combined, e.g.:

  • scatterplot, with groups connected
  • heatmap, with dendrogram
  • barchart, with error bars

Parts of Speech Graphics

  • Frame
  • Layer
  • Glyph
  • Guide
  • Facet
  • Scale
  • Annotation
  • Transform
  • Statistic

Glyph (or Geom, or Mark)

A glyph is a graphical element that conveys information:

Some Glyphs

Points

plot of chunk unnamed-chunk-3

Bars

plot of chunk unnamed-chunk-4

Paths

Frames

A piece of two-dimensional space.

  • Defined by two variables.

The variables can be either quantitative, categorical, or ordinal.

Quantitative vs Categorical

plot of chunk unnamed-chunk-6

Quantitative vs Quantitative

plot of chunk unnamed-chunk-7

Categorical vs Categorical

plot of chunk unnamed-chunk-8

Guides

A guide helps the human reader of a chart to ascertain the value of a variable for each case.

\(x\)- and \(y\)- axis are usual.

  • The number line is ordered.
  • Quantitative variables have a natural order.
  • Categorical variables do not. So an order must be specified.
    • Alphabetical is often used, but not often useful.

Other sorts of guides

  • Color
  • Size
  • Shape
  • Transparency

These are graphical attributes reflected in glyphs. The guide tells you how the attribute is related to the value or level of the corresponding variable.

A guide is the displayed manifestation of a scale. The scale translates the variable into a graphical attribute.

Example

Example

plot of chunk unnamed-chunk-10

Layers

Let's add some new data in a new layer: the shape of states. plot of chunk unnamed-chunk-11

Dynamite

plot of chunk unnamed-chunk-12

Second Layer

plot of chunk unnamed-chunk-13

Third Layer

plot of chunk unnamed-chunk-14

Fixing up

plot of chunk unnamed-chunk-15

Example 1

Example 2

Example 3

Example 4

Example 5

Example 6

Example 7

Example 8

Example 9