I'm drawing a standalone tikz picture and when I compile it one of the edges is cut off. I think it's because I'm using a shifted scope within the picture. (Edit, it may be due to the [x=2cm,y=2cm]
scale I have applied to the picture)
\documentclass[tikz,varwidth,border=5pt]{standalone}
\begin{document}
\begin{tikzpicture}[x=2cm,y=2cm]
\begin{scope}
\draw (0,0) rectangle (3,3);
\end{scope}
\begin{scope}[shift={(3.5,0)}]
\draw (0,0) rectangle (3,3);
\end{scope}
\end{tikzpicture}
\end{document}
The furthest right part of my picture is being cut off, I suspect the varwidth, border=5pt]
arguments aren't taking the shift
(edit: or maybe the scale) into account.
So my question is either:
- Is there a non-manual way of making sure the edges of my picture don't get cut off? (I'm aware of
\useasboundingbox
but would prefer not to use it) - Is there a better technique than
shift
to construct two pictures which are very similar but offset from one another by some amount? I don't want to have to draw the picture twice with different coordinates. From an editing point of viewshift
is much more efficient.
\draw (0,0) rectangle (1,1);
in bothscope
s isn't enough. For the second part you could have a look at using\pic
s. See chapter 18 in the manual, or the tikz-pic tag here on the site.shift
but due to a scaling of the whole picture I have:\begin{tikzpicture}[x=2cm,y=2cm]
. Now the problem is there when the shift is{3.5,0}
and the rectangles are(3,3)
large.varwidth
anyway, if you all you have is atikzpicture
it's pointless? (And apparently the cause of the problem.)