내 논문에는 기본 색상 개념과 나침반의 유사점을 논의하는 이미지가 있습니다. 원본 이미지는 페인트로 초라하게 밀어넣은 것인데 tikz
. 원본 이미지는 다음과 같습니다.
내 계획은 결국 이것과 막연하게 비슷한 것을 만드는 것이지만 지금은 검은 색으로 채우려는 영역이 채워지지 않고 내가 뭘 잘못하고 있는지 알 수 없기 때문에 막혔습니다. 현재로서는 다음과 같습니다.
나는 두 북쪽 선 사이의 영역을 검은색으로 표시하고 싶었습니다. 그리고 이것은 내 코드입니다:
\documentclass{book}
\usepackage{tikz}
\usetikzlibrary {decorations.pathmorphing}
\begin{document}
\begin{tikzpicture}[inner sep=0,outer sep=0,]
% circles (from centre)
\node[thick,draw=black,circle,
minimum size=1cm,
decorate,
decoration={random steps,segment length=1.5pt,amplitude=0.2pt}] (centre) at (0,0) {};
\node[thick,draw=black,circle,
minimum size=4.5cm,
decorate,
decoration={random steps,segment length=1.5pt,amplitude=0.2pt}] (inedge) at (0,0) {};
\node[thick,draw=black,circle,
minimum size=5cm,
decorate,
decoration={random steps,segment length=1.5pt,amplitude=0.2pt}] (outedge) at (0,0) {};
% main direction nodes
\begin{scope}[label distance=0.5cm]
% North
\node[thick,draw=black,circle,
minimum size=0.3cm,
label=above:\Large{$\mathcal{N}$}] (N) at (0,3.5) {};
\node[circle,draw=black,fill=black,
minimum size=1.5mm] (n) at (0,3.5) {};
% East
\node[thick,draw=black,circle,
minimum size=0.3cm,
label=right:\Large{$\mathcal{E}$}] (E) at (3.5,0) {};
\node[circle,draw=black,fill=black,
minimum size=1.5mm] (e) at (3.5,0) {};
% South
\node[thick,draw=black,circle,
minimum size=0.3cm,
label=below:\Large{$\mathcal{S}$}] (S) at (0,-3.5) {};
\node[circle,draw=black,fill=black,
minimum size=1.5mm] (s) at (0,-3.5) {};
% West
\node[thick,draw=black,circle,
minimum size=0.3cm,
label=left:\Large{$\mathcal{W}$}] (W) at (-3.5,0) {};
\node[circle,draw=black,fill=black,
minimum size=1.5mm] (w) at (-3.5,0) {};
\end{scope}
% mainlines
\draw[thick,
decorate,
decoration={random steps,segment length=3pt,amplitude=0.1pt}]
(centre) -- (N);
\draw[thick,
decorate,
decoration={random steps,segment length=3pt,amplitude=0.1pt}]
(centre) -- (E);
\draw[thick,
decorate,
decoration={random steps,segment length=3pt,amplitude=0.1pt}]
(centre) -- (S);
\draw[thick,
decorate,
decoration={random steps,segment length=3pt,amplitude=0.1pt}]
(centre) -- (W);
% Main points
\filldraw[black] (-0.35cm,0.35cm) -- (N) -- (centre) -- cycle; % why u no fill?!!
\end{tikzpicture}
\end{document}
내 코드가 매우 반복적이라는 것을 알고 있지만 측면을 정의하고 tikzpicture
생성하려고 시도했지만 /.style
성공하지 못했기 때문에 작동하도록 이 방식으로 수행하기로 결정하고 나중에 모든 작업이 완료되면 정리합니다. 세부 사항이 파악되었습니다.
답변1
노드 대신 좌표를 사용해야 합니다.
\documentclass{book}
\usepackage{tikz}
\usetikzlibrary {decorations.pathmorphing}
\begin{document}
\begin{tikzpicture}[inner sep=0,outer sep=0,]
% circles (from centre)
\node[thick,draw=black,circle,
minimum size=1cm,
decorate,
decoration={random steps,segment length=1.5pt,amplitude=0.2pt}] (centre) at (0,0) {};
\node[thick,draw=black,circle,
minimum size=4.5cm,
decorate,
decoration={random steps,segment length=1.5pt,amplitude=0.2pt}] (inedge) at (0,0) {};
\node[thick,draw=black,circle,
minimum size=5cm,
decorate,
decoration={random steps,segment length=1.5pt,amplitude=0.2pt}] (outedge) at (0,0) {};
% main direction nodes
\begin{scope}[label distance=0.5cm]
% North
\node[thick,draw=black,circle,
minimum size=0.3cm,
label=above:\Large{$\mathcal{N}$}] (N) at (0,3.5) {};
\node[circle,draw=black,fill=black,
minimum size=1.5mm] (n) at (0,3.5) {};
% East
\node[thick,draw=black,circle,
minimum size=0.3cm,
label=right:\Large{$\mathcal{E}$}] (E) at (3.5,0) {};
\node[circle,draw=black,fill=black,
minimum size=1.5mm] (e) at (3.5,0) {};
% South
\node[thick,draw=black,circle,
minimum size=0.3cm,
label=below:\Large{$\mathcal{S}$}] (S) at (0,-3.5) {};
\node[circle,draw=black,fill=black,
minimum size=1.5mm] (s) at (0,-3.5) {};
% West
\node[thick,draw=black,circle,
minimum size=0.3cm,
label=left:\Large{$\mathcal{W}$}] (W) at (-3.5,0) {};
\node[circle,draw=black,fill=black,
minimum size=1.5mm] (w) at (-3.5,0) {};
\end{scope}
% mainlines
\draw[thick,
decorate,
decoration={random steps,segment length=3pt,amplitude=0.1pt}]
(centre) -- (N);
\draw[thick,
decorate,
decoration={random steps,segment length=3pt,amplitude=0.1pt}]
(centre) -- (E);
\draw[thick,
decorate,
decoration={random steps,segment length=3pt,amplitude=0.1pt}]
(centre) -- (S);
\draw[thick,
decorate,
decoration={random steps,segment length=3pt,amplitude=0.1pt}]
(centre) -- (W);
% Main points
\filldraw[draw=red,fill=blue] (-0.35cm,0.35cm) -- (N.north) -- (centre.center) -- cycle; % why u no fill?!!
\end{tikzpicture}
\end{document}