tikzdevice

Rasterise ggplot images in R for tikzdevice

北城以北 提交于 2019-11-29 14:34:59
I use R to analyse data, ggplot to create plots, tikzDevice to print them and finally latex to create a report. THe problem is that large plots with many points fail due to the memory limit of latex. I found here https://github.com/yihui/tikzDevice/issues/103 a solution that rasterises the plot before printing the tikz file, which allows printing the points and the text individually. require(png) require(ggplot2) require(tikzDevice) ## generate data n=1000000; x=rnorm(n); y=rnorm(n) ## first try primitive tikz("test.tex",standAlone=TRUE) plot(x,y) dev.off() ## fails due to memory system(

Rasterise ggplot images in R for tikzdevice

余生颓废 提交于 2019-11-28 08:44:13
问题 I use R to analyse data, ggplot to create plots, tikzDevice to print them and finally latex to create a report. THe problem is that large plots with many points fail due to the memory limit of latex. I found here https://github.com/yihui/tikzDevice/issues/103 a solution that rasterises the plot before printing the tikz file, which allows printing the points and the text individually. require(png) require(ggplot2) require(tikzDevice) ## generate data n=1000000; x=rnorm(n); y=rnorm(n) ## first

Using tikz graphdrawing library within RMarkdown … Need to use lualatex engine, but can't get it to work

亡梦爱人 提交于 2019-11-27 08:34:30
问题 I have the following code in an rmd file which leverages tikz for diagrams: --- title: "TestNonTufteLua" author: "Me" output: pdf_document : latex_engine: lualatex --- Prove tikz works: ```{r tikTest1, engine = "tikz"} \usetikzlibrary{shapes} \begin{tikzpicture} \node[ellipse, draw=black, align = center] (Data) {Data $y_{n}$}; \end{tikzpicture} ``` Then, when you set `eval = TRUE` in the below code, it will not work. ```{r tikTest2, eval = FALSE, engine = "tikz"} \usetikzlibrary{graphs,