I’ve got a question concerning the creation of two plots in a row, using R with Package tikz device to send the tikz to Latex. What I want to do is, plotting 2 graphs in a row. What I did first was to create to plots in the par(mfrow=c(1,2)) ambiance. But this doesn’t work good, because the Plots are like vertical rectangles, when printing with Latex. What I want to have is to get two pictures in a row which are quadratic. So what I did next, I created a layout:
Layout<- matrix(c(1, 2), nrow = 1, ncol=2, byrow = TRUE)
nf <- layout(mat = Layout, widths = c(1,1),heights = c(1,1), respect = TRUE)
layout.show(nf)
and plotted the two graphs. The result is quadratic (that’s good), but when I add a caption to the two plots (in Latex) it is far out from the graph. What am I suppose to do? Any thougts are appreciated!
As Greg mentioned, you have to adjust the width and the height of the plot canvas if you want square plots but don’t want R to fill in large borders of whitespace.
Here is a minimal example using Sweave:
The resulting figure looks like this: