View source: R/plot.waffle.bf.R
plot.waffle.bf | R Documentation |
Plot a waffle chart with dividing lines and labels This function requires you to know the distribution of the squares already. In the future there will be a wrapper that helps you with determining the proportions
## S3 method for class 'waffle.bf'
plot(named.vector, row.num = 5, colours = NULL,
plot.title = "", plot.fig.num = "", plot.cat.title = "", caption = "",
x.axis = "", dividing.line = FALSE, labels = FALSE, label.unit = "",
export = FALSE, export.name = "Rplot")
named.vector |
A named vector that is of the form c("label"=num.square) |
row.num |
Number of rows to put in a waffle chart |
colours |
Vector (or set.colour function) of colours to use. If not, default palette is generated. |
plot.title |
Character denoting title of the plot |
plot.fig.num |
Character denoting plot number (or another plot annotations) |
plot.cat.title |
Legend title for the colour of the plot |
caption |
String that sets the caption: Sources, notes stc |
x.axis |
Notes to be placed - Recommended place to put what each square means if not clear already |
dividing.line |
TRUE/FALSE on whether we want to display the dividing lines between the groups |
labels |
TRUE/FALSE on whether we want to have labels on them or not |
label.unit |
character string that can add labels to it. Examples include "%" |
export |
TRUE/FALSE whether to export file as EPS under default options (height=scaled according to row number and cell number, width=12 inches) |
export.name |
Name of the exported EPS file |
ggplot2 object with all the right formatting
plot.waffle.bf(c("Red"=20,"Blue"=30,"Green"=50),label.unit="%")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.