ruk·si

📊 R
Stacked Bar Chart

Updated at 2011-09-04 23:45

Creating a stacked bar chart in R.

opening_matrix <- as.matrix(openings_in_finland[,5:6])
# number,number = first bar
# number,number = second bar
# number,number = so on
# number,number
# number,number
# number,number

# t() flips the matrix
barplot(
    t(opening_matrix),
    border= NA,
    space= 0.25,
    ylim= c(0,50000),
    xlab= "Quarter",
    ylab= "Openings",
    main= "Job openings in Finland, from 2003 1st to 2010 2nd.",
    sub= "by Tommi Laine, source www.stat.fi"
)