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.

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
add comment

1 Answer

up vote 12 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 at 17:04
    
@Konne Glad it helped :-) –  Harish Kumar Feb 26 at 23:51
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.