pie_addimages {tastypie} | R Documentation |
Add images to pie charts
Description
This function allows to easily add some figures to you pie chart, taking information
from the output of the pie_bake
function.
You can also customize the chart by specifying the colors of borders and labels, the
title of the pie chart and where (and if) you want to print the percentages
for each group.
Usage
pie_addimages(
mypie,
imglist,
perc = "no",
lbl_col = "black",
border_col = "black",
title = ""
)
Arguments
mypie |
A ggplot object. The output from |
imglist |
A list of objects returned by and |
perc |
You can choose among:
|
lbl_col |
A string containing the chosen color for the labels, default is
|
border_col |
A string containing the chosen color for the border of the pie
chart, default is |
title |
A string. If you want, you can specify the title of the graph. |
Value
A ggplot object.
See Also
Please note that this function is based on the imagepie
function.
Examples
img5 <- jpeg::readJPEG(system.file("img", "pie.jpeg", package = "tastypie"))
imgs2 <- list(img5, img5, img5)
df2 <- data.frame(
c("A", "B", "C"),
c(300, 250, 600)
)
mypie2 <- pie_bake(df2, template = "rainbow1")
pie_addimages(
mypie = mypie2,
imglist = imgs2,
perc = "right",
lbl_col = "darkcyan",
border_col = "orangered",
title = "Example"
)