TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a way to combine rounded corners and arc? If I try it like this, I always get "additional lines".

I need the black shape (without lines on both corners) and the 180 degree rotated version.

\documentclass{standalone}
\usepackage{pgfplots}                 
\usepackage{tikz}
\usetikzlibrary{shadows, shadows.blur, shapes, arrows, positioning, circuits.ee.IEC, decorations, matrix, intersections, patterns, shapes}   % Zusätzlich Libraries, werden standardmäßig nicht geladen
\pgfplotsset{compat=newest}




\begin{document}


\begin{tikzpicture}

\begin{axis}[name=plot1, xmin=-3, xmax=3, ymin=-3, ymax=3, x=2cm, y=2cm, ytick=\empty, xtick=\empty,
            axis lines=none, disabledatascaling]

            \draw[-, thin, blue]{[rounded corners=20pt] (0, 1.6) -- (1.4, 1.6) -- (0, 2.6) -- (-1.4, 1.6) -- (0, 1.6)}; 

            \draw[-, thin]{[rounded corners=20pt] (0, 0.1) -- (1.4, 0.1) -- (1.4, 0.1) arc[start angle=0, end angle=180, radius=1.4] -- (-1.4, 0.1) -- (0, 0.1)};               

            \draw[-, thin, red]{[rounded corners=20pt] (0, -0.1) -- (1.4, -0.1) -- (1.4, -0.1) arc[start angle=0, end angle=-180, radius=1.4] -- (-1.4, -0.1) -- (0, -0.1)};

        \end{axis}


\end{tikzpicture}       

\end{document}

pic1

Thanks, Konne.

share|improve this question
up vote 13 down vote accepted

Like this?

enter image description here

Code:

\documentclass[border=10pt]{standalone}
\usepackage{pgfplots}
\usepackage{tikz}
\usetikzlibrary{shadows, shadows.blur, shapes, arrows, positioning, circuits.ee.IEC, decorations, matrix, intersections, patterns, shapes}   % Zusätzlich Libraries, werden standardmäßig nicht geladen
\pgfplotsset{compat=newest}

\begin{document}


\begin{tikzpicture}

\begin{axis}[name=plot1, xmin=-3, xmax=3, ymin=-3, ymax=3, x=2cm, y=2cm, ytick=\empty,
                     xtick=\empty, axis lines=none, disabledatascaling]

            \draw[-, thin, blue]{[rounded corners=20pt] (0, 1.6) -- (1.4, 1.6) -- 
                   (0, 2.6) -- (-1.4, 1.6) -- (0, 1.6)};

            \draw[-, thin,rounded corners=20pt] (0, 0.1) -- (1.4, 0.1)  arc[start
                   angle=0, end angle=180, radius=1.4] -- (0, 0.1);

            \draw[-, thin, red,rounded corners=20pt] (0, -0.1) -- (1.4, -0.1)
                   arc[start angle=0, end angle=-180, radius=1.4] -- (0, -0.1);

        \end{axis}


\end{tikzpicture}

\end{document}

Instead of

\draw[-, thin]{[rounded corners=20pt] (0, 0.1) -- (1.4, 0.1) -- (1.4, 0.1) arc[start
                         angle=0, end angle=180, radius=1.4] -- (-1.4, 0.1) -- 
                         (0, 0.1)}; 

you should use

\draw[-, thin,rounded corners=20pt] (0, 0.1) -- (1.4, 0.1)  arc[start angle=0, end
                          angle=180, radius=1.4] -- (0, 0.1);

then every thing works.

share|improve this answer
    
That's it, thanks! – Konne Feb 26 '14 at 17:04
    
@Konne Glad it helped :-) – Harish Kumar Feb 26 '14 at 23:51

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.