Description Usage Arguments Details Value Author(s) See Also Examples
The imagepie
function is a tool for creating versatile pie charts
by filling the slices with external png and jpeg images.
1 2 3 4 5 6 7 8 9 10 11 |
group |
a vector of strings, containing the names of each slice. |
pct |
a vector of non-negative numbers, containing percentages of each group. The numbers must sum up to 100. |
label |
a vector of strings, giving the names for the slices shown in the pie chart. |
label.size |
the font size of labels shown in the pie chart. |
label.color |
the color of labels shown in the pie chart. |
label.distance |
the distance of labels from the border of the pie chart. |
pattern.type |
a list of objects returned by |
frame.color |
the color for the borders of slices. |
frame.size |
a numeric value, the line size for the borders of slices. |
imagepie
function offers flexible ways of doing pie charts.
A ggplot object.
Chunqiao Luo (chunqiaoluo@gmail.com)
Function patternpie
1 2 3 4 5 6 7 8 9 10 11 12 13 | library(patternplot)
library(jpeg)
library(ggplot2)
Tomatoes <- readJPEG(system.file("img", "tomatoes.jpg", package="patternplot"))
Peas <- readJPEG(system.file("img", "peas.jpg", package="patternplot"))
Potatoes <- readJPEG(system.file("img", "potatoes.jpg", package="patternplot"))
#Example 1
data <- read.csv(system.file("extdata", "vegetables.csv", package="patternplot"))
pattern.type<-list(Tomatoes,Peas,Potatoes)
imagepie(group=data$group,pct=data$pct,label=data$label,pattern.type=pattern.type,
label.distance=1.25,frame.color='burlywood4', frame.size=0.8, label.size=6,
label.color='forestgreen')
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.