STAT 451, Day 21 Continued

Visualizing Proportions

Donut Chart

Same as the pie chart with a hole in the middle.

Arc Length

donut.html

Site with code

Show the download of the html file and the use of Protovis. Change the data and the labels.

Lollipop Graph

Lollipop plots

Shows the relationship between two variables, at least one of which is numeric.

Stacked Bar Graph

stacked-bar.html

Show the download of the html file and the use of Protovis. Change the graph to read President Obama.

Hierarchy and Rectangles

Treemap

WinDirStat

Baobab

Ringschart

Or try a mosaic plot.

Treemap in R

library(portfolio)

posts <- read.csv("http://datasets.flowingdata.com/post-data.txt")

map.market(id=posts$id, area=posts$views, 
           group=posts$category, 
           color=posts$comments, 
           main="FlowingData Map")

plot of chunk unnamed-chunk-1

Proportions over Time

Stacked Area Chart

Author uses Flash and ActionScript

Easy way, Flare

Now Flash Builder

Point-by-Point

One disadvantage to the stacked area graph is that it can be hard to see trends for each group because the placement of each point is affected by the points below it.

So sometimes a better way is to plot proportions as a straight time series like in the previous chapter.

Slide With R Code

From the Quick-R website.

Advanced Graphs

Mosaic

# Mosaic Plot Example
library(vcd)
mosaic(HairEyeColor, shade=TRUE, legend=TRUE)

plot of chunk unnamed-chunk-2