18

This post is rather lengthy. I will attempt to address both of your main questions. Sorry for the novel ... Question 1 The following example tries to plot the same thing three times: First without tikzDevice and then in two tikzDevice-ways. The tikzDevice-slides are not very nice looking, which I can improve by manipulating the widths and heights. But ...


5

The main source of blank space is the use of \include instead of \input. Compare: If you consider the spacing still too large, you can edit your example.tex (tikzdevice output). It begins with: \begin{tikzpicture}[x=1pt,y=1pt,scale=0.5] \definecolor{fillColor}{RGB}{255,255,255} \path[use as bounding box,fill=fillColor,fill opacity=0.00] (0,0) rectangle (...


4

Your code produces not only no usable output file, but also error messages. This should be a clear warning that something is wrong. Anyway, the following works: library(tikzDevice) library(ggplot2) y <- exp(seq(1,10,.1)) x <- 1:length(y) data <- data.frame(Year = x, Numbers2 = y, Level = 1) tikz('Figure_1.tex', width = 3.5, height=3) Figure_1 <-...


4

You can do this with three plots: One for the decreasing lines, one for the increasing ones (with dots), and one for the row of six dots at the top. To make the increasing lines stop at the last decreasing one, you can use a comparison operator that becomes 0 when the increasing line is higher than the last decreasing one, and divide by that: Unbounded ...


3

Personally I do not know much about R, but helped prepare a book that used R plots throughout back in 2012. The book is set in Kp-fonts and we wanted as much as we could in that font from R as well (all titles and legends were replaced via psfrag to get proper LaTeX formatting of those, but handling the numbers on axis was a bit too much for psfrag. Here is ...


2

For the two problems: The dictionary file in indeed re-written for every single plot, and there is no way to avoid it. Actually the filehash package is used, so it will not be as slow as you may imagine. You can also turn on caching to avoid repetitive computing. You can specify different dictionary file paths for different reports, e.g. after options(...


2

Yihui answered the question: This turns out to be a bug of tikzDevice package, which has been reported long time ago (but still not fixed). The problem is the regular expression used to detect the pointsize was wrong (they should have used pt instead of [pt]): > tikzDevice:::getDocumentPointsize function (docString) { psLocation <- regexpr("\\d+[...


2

The plotsize can be regulated by using aspect.ratio = 2/(1+sqrt(5) as mentioned here (in my comment above, I copied the wrong source. sorry.) In code: tikz(file = "my_output_file1.tex", standAlone=F, width = 7, height = 3, ) cars['dt'] = seq(Sys.Date(),Sys.Date()-980,-20) plot1 <- ggplot(cars,aes(y=speed,x=dist,color=as....


2

In one word: knitr. In more words: Save it as example.Rnw and compite and edit With Rstudio, then use the "Compile PDF" button. \documentclass[11pt]{article} \usepackage[paper=a4paper, top=1in,bottom=1.1in,right=0.9in,left=0.9in]{geometry} \begin{document} I want all fonts in R plots to be exactly like this one. <<dev="tikz", echo=F, fig.cap="A tikz ...


1

You could use \resizebox like this: \resizebox{\linewidth}{!}{\input{../plot_CIs.tex}} Untested since you do not provide a minimal and complete example. Alternatively you could adjust the width argument in the tikz(...) call.


1

I solved the problem, just use: xlab("$\\gamma_{0}$")


1

Use \input instead of \includegraphics. Do not forget to set the proper width and height of your graphic chunks Example: tikz(file="cars.tex", width=2, height=2) par(mar=c(2,2,0.5,0.5)) plot(cars, xlab="", ylab="") dev.off() \documentclass{article} \usepackage{tikz} \begin{document} \begin{tabular}{ll} \input{cars} & \input{cars}\\ \input{cars} &...


1

I suggest using the floatrow package, by which you can set font preferences both globally and locally. In the preamble, add \usepackage{floatrow}, to which you may pass default options for the fonts you want to use throughout the document. Then if you want to change the options for figure fonts you can at anytime call \floatsetup{font={sf}} and it will ...


1

tikzDevice uses the default document font. So if your document is in sans serif, put in the preamble of your document \renewcommand{\familydefault}{\sfdefault} and both text and tikz labels will be in sans serif. But what if you want the text in serifed font, but tikz labels in sans (not that I recommend it)? Well, you can fool tikzDevice by setting ...


1

I have discovered that, at least under Windows 7 (64 bit), there appears to be a race condition in the OS (maybe there is some sort of caching of the directory that takes a while to update?), where the lockfile is sometimes deleted, but a subsequent call to create a lockfile fails because the OS reports the lockfile is still present. This happens ...


Only top voted, non community-wiki answers of a minimum length are eligible