1

Question: I want to draw dotted line between points E and F

MWE:

\documentclass[12pt]{article}
\usepackage{pgf,tikz,pgfplots}
\usetikzlibrary{arrows}
\begin{document}
    \begin{tikzpicture}
    \draw [line width=0.5pt] (-2,4)-- (2,4);
    \draw [line width=0.5pt] (-2,4)-- (-3,0);
    \draw [line width=0.5pt] (-3,0)-- (3,0);
    \draw [line width=0.5pt] (2,4)-- (3,0);
    \draw [line width=0.5pt] (-2,4)-- (3,0);
    \draw [line width=0.5pt] (-3,0)-- (2,4);
    \draw [line width=0.5pt] (-2.4,2.40)-- (2.40,2.40);
    \draw[color=black] (-2.00,4.4) node {$A$};
    \draw[color=black] (2.0,4.4) node {$B$};
    \draw[color=black] (-3.25,0.00) node {$C$};
    \draw[color=black] (3.25,0.00) node {$D$};
    \draw[color=black] (-2.65,2.45) node {$E$};
    \draw[color=black] (2.65,2.40) node {$F$};
    \end{tikzpicture}
\end{document}

1 Answer 1

1

Just add dotted option to corresponding draw command:

\documentclass[12pt]{article}
\usepackage{pgf,tikz,pgfplots}
\usetikzlibrary{arrows}
\begin{document}
    \begin{tikzpicture}
    \draw [line width=0.5pt] (-2,4)-- (2,4);
    \draw [line width=0.5pt] (-2,4)-- (-3,0);
    \draw [line width=0.5pt] (-3,0)-- (3,0);
    \draw [line width=0.5pt] (2,4)-- (3,0);
    \draw [line width=0.5pt] (-2,4)-- (3,0);
    \draw [line width=0.5pt] (-3,0)-- (2,4);
    \draw [line width=0.5pt, dotted] (-2.4,2.40)-- (2.40,2.40); %<-----
    \draw[color=black] (-2.00,4.4) node {$A$};
    \draw[color=black] (2.0,4.4) node {$B$};
    \draw[color=black] (-3.25,0.00) node {$C$};
    \draw[color=black] (3.25,0.00) node {$D$};
    \draw[color=black] (-2.65,2.45) node {$E$};
    \draw[color=black] (2.65,2.40) node {$F$};
    \end{tikzpicture}
\end{document}

enter image description here

1
  • Thanks a lot...... Now it works for me. Actually i was making mistake by adding dotted line instead of dotted.
    – SandyM
    Commented Apr 10, 2019 at 8:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .