
다음은 간단한 전체 예입니다.
\documentclass{article}
\usepackage{graphicx}
\usepackage{pgfplots, tikz}
\usetikzlibrary{positioning}
\begin{document}
\section{}
\begin{figure}
\newcommand\radius{2}
\newcommand\spacing{2}
\centering
\begin{tikzpicture}
\draw (-\radius-\spacing/2, 0) circle (\radius);
\draw (\radius+\spacing/2, 0) circle (\radius) node[anchor = north west]{Test};
\end{tikzpicture}
\caption{Caption}
\end{figure}
출력은 다음과 같습니다
하지만 내가 원하는 것은 "Test" 텍스트가 원의 북서쪽에 있다는 것입니다.국경. 원의 북서쪽에 닻을 내리는 것 같아센터대신에. 어떻게 해결할 수 있나요?
답변1
를 사용하면 \draw (<x>,<y>) circle[radius=<r>] node[anchor=north west] {Test};
노드가 점 에 배치됩니다 (<x>,<y>)
. 해결책은 지점에 노드를 별도로 배치하는 것입니다 ({3+2*cos(135)},{2*sin(135)})
.
pgfmanual에 따르면 구문이 \draw (3,0) circle (2);
오래되었습니다. 최신 구문은 \draw (3,0) circle[radius=2];
.
\documentclass[border=6pt]{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\draw (-3,0) circle[radius=2];
\draw (3,0) circle[radius=2];
\fill ({3+2*cos(135)},{2*sin(135)}) circle[radius=2pt];
\node[anchor=north west] at ({3+2*cos(135)},{2*sin(135)}) {Test};
\end{tikzpicture}
\end{document}