
중앙원(총회)에서 경제사회이사회와 국제형사재판소 원까지 세 원 모두에 대한 선의 입사각이 0도, 즉 선이 0도가 되도록 선을 그리려고 합니다. 원 표면과 90도 각도입니다. 지금 당장 이것이 내가 가지고 있는 것입니다.
\documentclass{article}
\usetikzlibrary{calc}
\usetikzlibrary{matrix, shapes}
\usepackage{tikz}
\usepackage{pgfplots}
\usetikzlibrary{snakes}
\usetikzlibrary{positioning, intersections}
\pgfplotsset{compat=1.10}
\begin{document}
\begin{figure}[H]
\label{fig:structure}
\centering
\begin{tikzpicture}
\node[xshift=6cm,draw,regular polygon, regular polygon sides=4,text width=3cm,align=center] (sa)
{{\Large Specialized agencies}:\\
\textbullet FAO\\
\textbullet ILO\\
\textbullet ITU\\
\textbullet WHO};
\node[minimum size= 4.5cm, xshift=12cm,draw,circle, text width=3cm,align=center] (ga) {\Large{General Assembly}\\
\small{1 nation, 1 vote}};
\node[xshift=12cm,yshift=-5cm,draw, circle, text width=3cm,align=center] (sc) {\Large Security Council\\
\small{5 permanent members\\
10 rotating members chosen by GA}};
\node[xshift=12cm,yshift=5cm,draw,circle, text width=3cm,align=center] (sg) {\Large Secretary General\\
\small{Supports GA decisions}};
\node[xshift=17cm,yshift=2cm,draw,circle, text width=3cm,align=center] (ecsoc) {\Large Economic and Social Council
};
\node[xshift=17cm,yshift=-2cm,draw,circle, text width=3cm,align=center] (icc) {\Large International Criminal Court
};
\draw (sa.east) -- (ga.west);
\draw (sg.south) -- (ga.north);
\draw (sc.north) -- (ga.south);
\draw (ga.east) -- (ecsoc.west);
\draw (ga.east) -- (icc.west);
\end{tikzpicture}
\caption{Structure of the United Nations}
\end{figure}
\end{document}
답변1
원 테두리에 수직이어야 한다는 뜻이라면 대신에 in 과 같은 것을 --
사용하세요 . 이렇게 하면 선이 0도(오른쪽)에서 나오고 180도(왼쪽)로 들어갑니다.edge[out=0, in=180]
\draw (ga.east) edge[out=0, in=180] (ecsoc.west);
또한 Tikz 라이브러리를 모두 한 곳에 쉼표로 구분하여 작성하세요.~ 후에오류가 발생하지 않도록 Tikz 패키지를 호출합니다. 나는 일반적으로 필요한 모든 패키지를 나열한 다음 적용 가능한 경우 라이브러리를 모두 나열합니다. 이렇게 하면 이해하기가 더 쉽고 체계적으로 정리됩니다.
\documentclass{article}
\usepackage{tikz}
\usepackage{pgfplots}
\usetikzlibrary{positioning, intersections, calc, matrix, shapes, snakes}
\pgfplotsset{compat=1.10}
\begin{document}
\begin{figure}[H]
\label{fig:structure}
\centering
\begin{tikzpicture}
\node[xshift=6cm,draw,regular polygon, regular polygon sides=4,text width=3cm,align=center] (sa)
{{\Large Specialized agencies}:\\
\textbullet FAO\\
\textbullet ILO\\
\textbullet ITU\\
\textbullet WHO};
\node[minimum size= 4.5cm, xshift=12cm,draw,circle, text width=3cm,align=center] (ga) {\Large{General Assembly}\\
\small{1 nation, 1 vote}};
\node[xshift=12cm,yshift=-5cm,draw, circle, text width=3cm,align=center] (sc) {\Large Security Council\\
\small{5 permanent members\\
10 rotating members chosen by GA}};
\node[xshift=12cm,yshift=5cm,draw,circle, text width=3cm,align=center] (sg) {\Large Secretary General\\
\small{Supports GA decisions}};
\node[xshift=17cm,yshift=2cm,draw,circle, text width=3cm,align=center] (ecsoc) {\Large Economic and Social Council
};
\node[xshift=17cm,yshift=-2cm,draw,circle, text width=3cm,align=center] (icc) {\Large International Criminal Court
};
\draw (sa.east) -- (ga.west);
\draw (sg.south) -- (ga.north);
\draw (sc.north) -- (ga.south);
\draw (ga.east) edge[out=0, in=180] (ecsoc.west);
\draw (ga.east) edge[out=0, in=180] (icc.west);
\end{tikzpicture}
\caption{Structure of the United Nations}
\end{figure}
\end{document}
그런데 "느슨함" 키를 추가하여 곡선 모양을 수정할 수 있습니다. 기본값은 1입니다. 0은 직선을 만들고 숫자가 증가할수록 곡선이 강조됩니다. 예는 다음과 같습니다(검은색이 표준 또는 1입니다).
\documentclass{standalone}
\usepackage{tikz}
\usepackage{pgfplots}
\usetikzlibrary{positioning, intersections, calc, matrix, shapes, snakes}
\pgfplotsset{compat=1.10}
\begin{document}
\begin{tikzpicture}
\node[draw, circle, text width=3cm, align=center] (ga) {\Large General Assembly};
\node[draw, circle, text width=3cm, align=center, xshift=6cm, yshift=3cm] (ecsoc) {\Large Economic and Social Council};
\draw[green] (ga.east) edge[out=0, in=180, looseness=0] (ecsoc.west);
\draw (ga.east) edge[out=0, in=180, looseness=1] (ecsoc.west);
\draw[red] (ga.east) edge[out=0, in=180, looseness=5] (ecsoc.west);
\draw[blue] (ga.east) edge[out=0, in=180, looseness=10] (ecsoc.west);
\end{tikzpicture}
\end{document}