Questions tagged [tikzdevice]

37 questions
10
votes
2 answers

Include TikZ code in bookdown figure environment

I'd like to add a TikZ figure to a bookdown document in order to include some fancy graphics. My primary output format is LaTeX which means that I could essentially just include the TikZ graphics verbatim in the Rmarkdown file and it would render…
ekstroem
  • 5,957
  • 3
  • 22
  • 48
6
votes
2 answers

Rasterise ggplot images in R for tikzdevice

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…
Jonas
  • 1,639
  • 1
  • 18
  • 29
5
votes
2 answers

grid_plot + tikzDevice + shared legend with latex mark up

I've been trying to follow this vignette on how to make a shared legend for multiple ggplot2. The given examples work perfectly as is, but in my case, I'm using tikzDevice to export a tikzpicture environment. The main problem seems to be that the…
4
votes
1 answer

use of tikzdevice in RMarkdown with beamer output

I was wondering whether tikzdevice package can be used for producing R plots in RMarkdown, to be exported to a beamer presentation. I would have thought that the solution I am looking for might be similar to the example with Sweave on page 15 of…
Michael
  • 154
  • 1
  • 11
4
votes
0 answers

Incredibly slow compilation with knitr and tikzDevice

Reposting this from tex.stackexchange, since the tikzDevice tag seems fairly inactive there. I hope nobody minds... I am having some compilation difficulties when using knitr and tikzDevice. Compilataion works, but I am seeing times upwards of 10…
beanstalker
  • 105
  • 1
  • 10
4
votes
2 answers

Using `round` or `sprintf` function for Regression equation in ggpmisc and `dev="tikz"`

How can I control the numeric display in Regression equation by using round or sprintf function? I also could not figure out how to use dev="tikz" when using eq.with.lhs = "hat(Y)~=~". library(ggplot2) library(ggpmisc) # generate artificial…
MYaseen208
  • 22,666
  • 37
  • 165
  • 309
3
votes
1 answer

How to resolve rmarkdown to latex errors involving tikz devices

I am trying to compile an rmarkdown document that includes a geographic plot into a PDF file. Here is a MWE: --- title: "Problems with maps in tikz" output: pdf_document --- ```{r setup, include=FALSE} library(ggplot2) library(sf) ``` ##…
gregmacfarlane
  • 2,121
  • 3
  • 24
  • 53
3
votes
0 answers

How to troubleshoot a tikzDevice error in running command?

I'm trying to use the R tikzDevice package in a Mac OS X system to enable clickable images in a PDF report. To that end I use the code of the answer How to have a clickable picture in a PDF created using pictureGrob? included here for…
SkyWalker
  • 13,729
  • 18
  • 91
  • 187
3
votes
1 answer

R tikzdevice: How to use sans serif font

I'm using ggplot in R to create plots, tikzdevice to save them and then latex to compile them in a larger document. when I create a very simple plot, e.g. require(ggplot2) require(tikzDevice) tikz("test.tikz", height = 4, width = 4) ggplot(data =…
Jonas
  • 1,639
  • 1
  • 18
  • 29
3
votes
1 answer

ggplot2: Degree Celsius Symbol in labeller with dev="tikz" option in knitr

I want to put degree Celsius symbol in ggplot2 labeller. MWE is given below with its output: library(ggplot2) ggplot(data=mtcars, mapping = aes(x=drat, y=mpg)) + geom_point() + facet_wrap(facets = ~cyl, labeller = as_labeller(c(`4` = "4 °C",`6` =…
MYaseen208
  • 22,666
  • 37
  • 165
  • 309
2
votes
0 answers

Generating a plot with tikzDevice and ggplot2

I can't get tikzDevice to work with ggplot2. I have taken a mwe from another question: https://tex.stackexchange.com/questions/322091/plotsizes-plotting-with-ggplot2-in-r-and-using-tikzdevice But it is producing an empty file, just with a heading…
esperluette
  • 1,792
  • 2
  • 14
  • 21
2
votes
1 answer

tikzDevice main caption without boldface

I have recently started using tikzDevice in R to create plots to be compiled in LaTeX. However, I haven't found a way to get rid of the boldface font in the main caption. As an example, I create the following graph in…
Santiago
  • 37
  • 5
2
votes
0 answers

Error in getMetricsFromLatex(TeXMetrics, verbose = verbose)

When compiling R code within a child, I get the following error. Error in getMetricsFromLatex(TeXMetrics, verbose = verbose) : TeX was unable to calculate metrics for the following string or character: m Common reasons for failure include: …
isokinetic
  • 21
  • 2
2
votes
1 answer

Reducing the output file size of tikzDevice

I'm writing a large latex document with lots of plots generated by R's tikzDevice package. Currently, I'm experiencing LaTeX error "TeX capacity exceeded". I've managed to fix this issue temporarily by following the remedy from Leo Liu's answer…
2
votes
0 answers

Rmarkdown: pass 'standAlone' option to tickzdevice with knitr

I am sucessfully compiling my .rmd-file into html or pdf_documents with the global option of dev='tikz'. Unfortunately the resulting .tikz-files have a latex-body around them, which prevents me from including them as child documents in…
stats-hb
  • 958
  • 13
  • 31
1
2 3