How to solve mismatch of thick curves in tikz?

Consider following MWE:

\begin{tikzpicture}
\draw (0,0) -- (1,1) -- (2,0);
\draw plot [smooth, tension=1.5] coordinates{(0,0) (1,-1) (2,0)};
\begin{scope}[xshift=3cm]
\draw[line width=1.5] (0,0) -- (1,1) -- (2,0);
\draw[line width=1.5] plot [smooth, tension=1.5] coordinates{(0,0) (1,-1) (2,0)};
\end{scope}
\end{tikzpicture}


that produces following picture:

In the right-hand part, because of the line width, there are 2 small "gaps" where the lines and the smooth curve join.

In some cases, it might be barely noticeable in print. But if it is the case, is there something you can do in Tikz that is smarter than vertically shifting the begin and end points of the curve, on order to obtain more overlap?

• you usually want to draw a single path then the corners are automatically taken care of. Dec 20, 2020 at 22:57
• If for some reason you are unable to draw a single path as @DavidCarlisle suggested, you can add [line cap=round] to the \draw command, which will hide the gaps pretty well. Or you can add it to the \scope options, or to the entire tikzpicture. Dec 21, 2020 at 2:21

\draw[line width=1.5] (1,1) -- (0,0) -- plot [smooth, tension=1.5] coordinates{(0,0) (1,-1) (2,0)} -- cycle; is ok?

• I think you do not need to double (0,0), i.e. \draw[line width=1.5] (1,1) -- plot [smooth, tension=1.5] coordinates{(0,0) (1,-1) (2,0)} -- cycle; is sufficient, but otherwise this is the correct answer.
– user231225
Dec 21, 2020 at 2:57
• @user231225 You are right. Dec 21, 2020 at 6:39

Draw a single path as advised by @DavidCarlisle, and a simple arc will suffice for this semicircular part of the diagram, no need for a plot.

\documentclass[tikz,border=5pt]{standalone}

\begin{document}

\begin{tikzpicture} [line width=1.5]
\draw (0,0) arc (-180:0:1) -- (1,1) -- cycle;
\end{tikzpicture}

\end{document}


• Yes, the arc was just an example, it could also be a more complex curve. Dec 21, 2020 at 15:40