Loose bounding box with circular arcs

Consider the following MWE:

\documentclass[border=5pt]{standalone}

\usepackage{tikz}

\begin{document}

\begin{tikzpicture}
\draw (0,0)  circle (1);
\draw[blue] (current bounding box.south west) rectangle
(current bounding box.north east);
%
\begin{tikzpicture}
\draw (0,0)  circle (1);
\draw[red] (200:1)  arc (200:320:1);
\draw[blue] (current bounding box.south west) rectangle
(current bounding box.north east);
%
\begin{tikzpicture}
\draw (0,0)  circle (1);
\draw[green] (320:1)  arc (320:560:1);
\draw[blue] (current bounding box.south west) rectangle
(current bounding box.north east);
%
\begin{tikzpicture}
\draw[red] (200:1)  arc (200:320:1);
\draw[green] (320:1)  arc (320:560:1);
\draw[blue] (current bounding box.south west) rectangle
(current bounding box.north east);
%
\begin{tikzpicture}
\draw[green] (320:1)  arc (320:560:1);
\draw[blue] (current bounding box.south west) rectangle
(current bounding box.north east);
%
\begin{tikzpicture}
\draw[red] (200:1)  arc (200:320:1);
\draw[blue] (current bounding box.south west) rectangle
(current bounding box.north east);
\end{tikzpicture}

\end{document}


I would expect the bounding box to fit tightly around the arcs. However, the picture shows a different behavior. I am sure there are experts around here who can explain me why this happens....

When TikZ calculates the bounding box for an arc, it uses the start, end and control points of the Bezier curves into account. The control points usually lie outside the arc.

The following example fixes the bounding boxes by a reset of the bounding box \pgfresetboundingbox and setting it again with a \draw command without lines using some points that define the bounding box. \draw is used instead of \path or \useasboundingbox, because it also takes the line width into account.

\documentclass[border=5pt]{standalone}

\usepackage{tikz}

\begin{document}

\begin{tikzpicture}
\draw (0,0)  circle (1);
\draw[blue] (current bounding box.south west) rectangle
(current bounding box.north east);
%
\begin{tikzpicture}
\draw (0,0)  circle (1);
\draw[red] (200:1)  arc (200:320:1);
\pgfresetboundingbox
\draw (-1, -1) (1, 1);
\draw[blue] (current bounding box.south west) rectangle
(current bounding box.north east);
%
\begin{tikzpicture}
\draw (0,0)  circle (1);
\draw[green] (320:1)  arc (320:560:1);
\pgfresetboundingbox
\draw (-1, -1) (1, 1);
\draw[blue] (current bounding box.south west) rectangle
(current bounding box.north east);
%
\begin{tikzpicture}
\draw[red] (200:1)  arc (200:320:1);
\draw[green] (320:1)  arc (320:560:1);
\pgfresetboundingbox
\draw (-1, -1) (1, 1);
\draw[blue] (current bounding box.south west) rectangle
(current bounding box.north east);
%
\begin{tikzpicture}
\draw[green] (320:1)  arc (320:560:1);
\pgfresetboundingbox
\draw (-1, 1) (1, 0) (320:1);
\draw[blue] (current bounding box.south west) rectangle
(current bounding box.north east);

• (+1) for giving me something useful to look up ;). But within a pic, for example, \pgf@relevantforpicturesizefalse is useful. (I freely concede this question had nothing at all to do with pics.)And the fit library can be useful if you have something less predictable than a circle. An extraterrestrial, say, or something like that ;). – cfr Feb 26 '16 at 18:21