使用 pgfplots 绘制的角度与使用 TikZ 绘制的角度相同

使用 pgfplots 绘制的角度与使用 TikZ 绘制的角度相同

我正在使用 pgfplots 绘制相交线。这些相交线组成三个直角三角形 - 其中两个在第三条线上。我试图通过使用命令和所做的标记来标记较小直角三角形中的两对等距锐角,TikZ并且\tkzMarkAngle[size=0.5cm,mark=|](B,A,P);\tkzMarkAngle[size=0.5cm,mark=||](A,B,P);试图通过使用TikZ命令所做的相同标记来标记任何\tkzMarkRightAngle(A,P,B);直角。如何在以下代码中标记等距锐角?与使用不同TikZ,我知道必须手动制作直角标记。由所做的直角标记的每一边的长度是多少TikZ?(我在其他页面上用绘制了直角三角形TikZ。我希望符号相同。)

\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}

\noindent \hspace*{\fill}
\begin{tikzpicture}
\begin{axis}[width=6in,axis equal image,clip=false,
    axis lines=middle,
    xmin=-5,xmax=10,samples=501,
    xlabel=$x$,ylabel=$y$,
    ymin=-8,ymax=11,
    restrict y to domain=-8:11,
    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[samples=501, latex-latex,domain=-5:10,blue] {x + 1} node[anchor=north west,pos=0.9,font=\footnotesize]{$y = mx + b$};
\addplot[samples=501, latex-latex,domain=-5:10,blue] {3 - x} node[anchor=south west,pos=0.9,font=\footnotesize]{$y = m^{\prime}x + b^{\prime}$};
\addplot [dashed, latex-latex,domain=-21:21] (6,x) node [pos=0.1, anchor=north, font=\footnotesize, sloped]{$x=x_{\circ}$};
\addplot [dashed, domain=1:6] {2};
(1,2) coordinate (B);
\draw [fill] (1,2) circle [radius=1.5pt] node[label=above:$B$]{};
(6,-3) coordinate (A);
\draw [fill] (6,-3) circle [radius=1.5pt] node[label=right:$A$]{};
(6,7) coordinate (C);
\draw [fill] (6,7) circle [radius=1.5pt] node[label=right:$C$]{};
(6,2) coordinate (P);
\draw [fill] (6,2) circle [radius=1.5pt] node[label=right:$P$]{};
\end{axis}
\end{tikzpicture}
\hspace{\fill}
\vskip0.25in

\end{document}

答案1

在环境内使用命名节点axis,然后在外面绘制角度标记axis

\documentclass[10pt]{amsart}
\usepackage{pgfplots}
\pgfplotsset{compat=1.11}
\usepackage{tkz-euclide}
\usetkzobj{all}
\begin{document}
\begin{tikzpicture}[
  dot/.style={circle,fill,inner sep=1.5pt,}
  ]
\begin{axis}[width=6in,axis equal image,clip=false,
    axis lines=middle,
    xmin=-5,xmax=10,samples=501,
    xlabel=$x$,ylabel=$y$,
    ymin=-8,ymax=11,
    restrict y to domain=-8:11,
    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[samples=501, latex-latex,domain=-5:10,blue] {x + 1} node[anchor=north west,pos=0.9,font=\footnotesize]{$y = mx + b$};
\addplot[samples=501, latex-latex,domain=-5:10,blue] {3 - x} node[anchor=south west,pos=0.9,font=\footnotesize]{$y = m^{\prime}x + b^{\prime}$};
\addplot [dashed, latex-latex,domain=-21:21] (6,x) node [pos=0.1, anchor=north, font=\footnotesize, sloped]{$x=x_{\circ}$};
\addplot [dashed, domain=1:6] {2};
\path
  (1,2)node[dot,label=above:$B$](B){}
  (6,-3)node[dot,label=right:$A$](A){}
  (6,7)node[dot,label=right:$C$](C){}
  (6,2)node[dot,label=right:$P$](P){};
\end{axis}
\tkzMarkAngle[size=0.5cm,mark=|](P,A,B);
\tkzMarkAngle[size=0.5cm,mark=||](A,B,P);
\tkzMarkRightAngle(A,P,B);
\end{tikzpicture}
\end{document}

在此处输入图片描述

相关内容