
이것은 내 코드입니다.
\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\tikzset{venn circle/.style={draw,circle,minimum width=4cm}}
\node [venn circle = white] (A) at (0,0) {$5 \hspace{1cm}$};
\node [venn circle = white] (C) at (0:2cm) {\hspace{1.7cm}$2$\\\\ \hspace{1cm} $2$};
\node[below] at (barycentric cs:A=1/2,C=1/2 ) {$5,3$};
\end{tikzpicture}
\end{document}
왼쪽 원 위에는 "75의 소인수"라는 라벨을 붙이고 오른쪽 위에는 "60의 소인수"라는 라벨을 붙이고 싶습니다. 어떻게 해야 하나요? 그렇게 하려면 벤다이어그램에 다른 코드를 사용해야 합니까?
답변1
노드에 대한 매개변수를 사용 label
하고 노드를 배치할 위치를 설정할 수 있습니다.
\documentclass{article} \usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\tikzset{venn circle/.style={draw,circle,minimum width=4cm}}
\node [venn circle = white] (A) at (0,0) [label={[xshift=-1.0cm, yshift=0.3cm]{\footnotesize Prime factors of 75}}] {$5 \hspace{1cm}$};
\node [venn circle = white] (C) at (0:2cm) [label={[xshift=1.0cm, yshift=0.3cm]{\footnotesize Prime factors of 60}}] {\hspace{1.7cm}$2$\\ \hspace{1cm} $2$};
\node[below] at (barycentric cs:A=1/2,C=1/2 ) {$5,3$};
\end{tikzpicture}
\end{document}