使用 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}

在此輸入影像描述

相關內容