infigure | R Documentation |
import figures and extract the colors used in the figures
infigure( filename, format = NULL, exclude_col = NULL, topn = 10, showfig = FALSE, showcol = FALSE, savegg = FALSE, density = 300, pages = NULL )
filename |
input filename |
format |
format of input file |
exclude_col |
vector of colors to be excluded from the analysis |
topn |
display the most frequent colors |
showfig |
display the figure or not (default: FALSE) |
showcol |
display extracted colors or not (default: FALSE) |
savegg |
save the figure as ggplot2 object or not (default: FALSE) |
density |
resolution to render pdf |
pages |
integer vector with page numbers (pdf file). Defaults to all pages. |
Kai Guo
if(interactive()){ require(ggplot2) p <- ggplot(mtcars, aes(mpg, disp, color = factor(cyl))) + geom_point() tofigure(p,filename = file.path(tempdir(), "mtcars.pdf")) pp <- infigure(filename = file.path(tempdir(), "mtcars.pdf"), exclude_col="white") pp }
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.