2

In the following code, two triangles are drawn - one is the reflection of the other across the line y=x. I would like to have a line, with the command \draw[loosely dash dot], drawn either half or a third the thickness of the dashed lines in triangle AB'C'. I would like the line to contain the line segment between B' and C'. To do that, I need to either move the nodes B' and C' to the right or I need to have B' and C', with some space about them, typeset over the line.

\documentclass[10pt]{amsart}
\usepackage{tikz}
\usetikzlibrary{calc,angles,positioning,intersections,quotes,decorations.markings}
\usepackage{mathtools,systeme,array}

\usepackage{tkz-euclide}
\usetkzobj{all}
\usepackage{pgfplots}
\pgfplotsset{compat=1.11}


\begin{document}


\begin{tikzpicture}
\begin{axis}[width=4in,axis equal image,clip=false,
axis lines=middle,
xmin=-7,xmax=17,
xlabel=$x$,ylabel=$y$,
ymin=-7,ymax=17,
restrict y to domain=-7:17,
enlargelimits={abs=0.25cm},
axis line style={latex-latex},
ticklabel style={font=\tiny,fill=white},
xtick={\empty},ytick={\empty},
xlabel style={at={(ticklabel* cs:1)},anchor=north west},
ylabel style={at={(ticklabel* cs:1)},anchor=south west}
]
\addplot[dashed,latex-latex,samples=2,domain=-6:16]{x};


\draw (axis cs:-3,-3) coordinate(A) node[above left]{$A$};
\draw (axis cs:0,10.5) coordinate(B) node[above left]{$B$};
\draw (axis cs:5,13) coordinate(C) node[above right]{$C$};
\draw (axis cs:3,9) coordinate(P);

\draw (axis cs:10.5,0) coordinate(b) node[below]{$B^{\prime}$};
\draw (axis cs:13,5) coordinate(c) node[above right]{$C^{\prime}$};
\draw (axis cs:9,3) coordinate(p);
\end{axis}

\draw (A) -- (B) -- (C) -- cycle;
\draw[dashed] (B) -- (P);
\tkzMarkRightAngle(A,P,B);

\draw[dashed] (A) -- (b) -- (c) -- cycle;
\draw[dotted] (b) -- (p);
\tkzMarkRightAngle[densely dotted](A,p,b);

\end{tikzpicture}



\end{document}
Adelyn
  • 3,373
  • You can change the width using \draw[line width=1pt] for example. – Sigur Jan 08 '15 at 12:41
  • @Sigur What is the default width? – Adelyn Jan 08 '15 at 12:51
  • 1
    See here: http://tex.stackexchange.com/a/65786/14757 – Sigur Jan 08 '15 at 13:04
  • Simply use line width=0.5\pgflinewidth. – user43963 Jan 08 '15 at 13:56
  • @user43963 Sigur gave me another answer. I like your answer, too. What page of the pgf manual is there a discussion on it. Do you know the answer to my other question - about putting the vertices B' and C' over the dotted line? I think it involves the inner separation option. – Adelyn Jan 08 '15 at 13:59
  • 1
    See page 1015 of pgfmanual section 100.2.1 for line width, for example. – user43963 Jan 08 '15 at 14:16
  • @user43963 "I would like the line to contain the line segment between B' and C'. To do that, I need to either move the nodes B' and C' to the right or I need to have B' and C', with some space about them, typeset over the line." – Adelyn Jan 08 '15 at 15:13
  • @Adelyn Like in the following answer of mine? – user43963 Jan 08 '15 at 15:34

1 Answers1

1

You can set the line width as commented by Sigur and the default line width can be accessed via \pgflinewidth

line width=0.5\pgflinewidth

For loosely dash dot line name the nodes bp and cp in

\draw (axis cs:10.5,0) coordinate(b) node[below](bp){$B^{\prime}$};
\draw (axis cs:13,5) coordinate(c) node[above right](cp){$C^{\prime}$};

and then

\draw[line width=0.5\pgflinewidth,loosely dash dot] (bp.center) -- (cp.center);

Here is the full code:

\documentclass[10pt]{amsart}
\usepackage{tikz}
\usetikzlibrary{calc,angles,positioning,intersections,quotes,decorations.markings}
\usepackage{mathtools,systeme,array}

\usepackage{tkz-euclide}
\usetkzobj{all}
\usepackage{pgfplots}
\pgfplotsset{compat=1.11}


\begin{document}


\begin{tikzpicture}
\begin{axis}[width=4in,axis equal image,clip=false,
axis lines=middle,
xmin=-7,xmax=17,
xlabel=$x$,ylabel=$y$,
ymin=-7,ymax=17,
restrict y to domain=-7:17,
enlargelimits={abs=0.25cm},
axis line style={latex-latex},
ticklabel style={font=\tiny,fill=white},
xtick={\empty},ytick={\empty},
xlabel style={at={(ticklabel* cs:1)},anchor=north west},
ylabel style={at={(ticklabel* cs:1)},anchor=south west}
]
\addplot[dashed,latex-latex,samples=2,domain=-6:16]{x};


\draw (axis cs:-3,-3) coordinate(A) node[above left]{$A$};
\draw (axis cs:0,10.5) coordinate(B) node[above left]{$B$};
\draw (axis cs:5,13) coordinate(C) node[above right]{$C$};
\draw (axis cs:3,9) coordinate(P);

\draw (axis cs:10.5,0) coordinate(b) node[below](bp){$B^{\prime}$};
\draw (axis cs:13,5) coordinate(c) node[above right](cp){$C^{\prime}$};
\draw (axis cs:9,3) coordinate(p);
\end{axis}

\draw (A) -- (B) -- (C) -- cycle;
\draw[dashed] (B) -- (P);
\tkzMarkRightAngle(A,P,B);

\draw[dashed] (A) -- (b) -- (c) -- cycle;
\draw[dotted] (b) -- (p);
\tkzMarkRightAngle[densely dotted](A,p,b);

\draw[line width=0.5\pgflinewidth,loosely dash dot] (bp.center) -- (cp.center);

\end{tikzpicture}



\end{document}
user43963
  • 1,570
  • No, the line is to go through the points (10.5,0) and (13,5). The placement of the nodes B' and C' would make for an awkward intersection. I would like to put B' and C', with some space about them, over this line. Again, I think that there is a option like inner separation for that. – Adelyn Jan 08 '15 at 16:06
  • @PaulGessler I tried to get your attention in the chat room yesterday. Did you get an alert? (Maybe you didn't have time.) The code that I have compiles correctly to give me a diagram of two triangles - one the reflection of the other across the line y=x. I want to draw a line through the points B'=(10.5,0) and C'=(13,5). The placement of the nodes B' and C' would make for an awkward intersection with this line, though. I would like to put B' and C', with some space about them, over this line. Again, I think that there is a option like inner sep=<dimension> for that. – Adelyn Jan 08 '15 at 18:17
  • @Adelyn Sorry I did not follow your requirements. May be you can draw some picture of what you need by hand and show. – user43963 Jan 08 '15 at 23:26