Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

The following is a minimal working example for what I'm trying to achieve. I need to create a figure that looks like an U, that is, a capital U. However the junction between each of the straight lines and the arc is "sloppy". Is there a way to improve that?

\documentclass{article}
\usepackage{tikz}

\begin{document}

\begin{tikzpicture}
\draw[very thick,blue] (0,10) -- (0,0);
\draw[very thick, blue] (0,0) arc (-180:0:3);
\draw[very thick, blue] (6,0) -- (6,10);
\end{tikzpicture}

\end{document}
share|improve this question
add comment

2 Answers

A quick way is to use the "to" operator for lines: replace your code by

\begin{tikzpicture}
\draw[very thick,blue] (0,10) -- (0,0) to[out=270,in=180] (3,-3) to [out=0,in=270] (6,0) -- (6,10);
\end{tikzpicture} 

This way you can specify the angles or directions that lines leave or approach a point.

share|improve this answer
add comment

I don't think there is anything wrong with the image, just your PDF viewer. Here is an image using Acrobat to view it zoomed in 1600%, where I have added the red circle around the center of where the lines join:

U as produced by OP's code

However, you could draw it all in one operation as per Frédéric's answer, or by rewriting your code as:

\draw[very thick,blue] (0,10) -- (0,0) arc (-180:0:3) -- (6,10);

Code:

\documentclass{article}
\usepackage{tikz}

\begin{document}

\begin{tikzpicture}
  \draw[very thick, red ] (0,0) circle (0.5cm);
  \draw[very thick, blue] (0,10) -- (0,0);
  \draw[very thick, blue] (0,0) arc (-180:0:3);
  \draw[very thick, blue] (6,0) -- (6,10);
\end{tikzpicture}

\begin{tikzpicture}
\draw[very thick, red] (0,0) circle (0.5cm);

\draw[line width=6pt,blue] (0,10) -- (0,0) arc (-180:0:3) -- (6,10);
\end{tikzpicture}

\end{document}
share|improve this answer
    
I'm using Acrobat as well, but for some reason there was a visible difference between the straight line and the arc. Both answers worked beautifully, though. Thanks a bunch. –  Francisco Nov 20 '12 at 20:07
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.