
LaTeX에서 어떻게 그릴 수 있나요? 많은 세그먼트로 작업할 수 있지만 다른 쉬운 방법이 있다고 생각합니다. 그리고 공간적 시각을 제공하는 이미지에 이 회색 검정색 배경을 어떻게 추가할 수 있습니까?
답변1
3차원 좌표로 플롯할 수 있습니다. 이렇게 하면 시작됩니다.
다이어그램의 다른 부분을 그리는 순서가 중요합니다. 음영 부분을 먼저 그려서 다른 선 "뒤"에 놓이도록 했습니다.
\documentclass[border=5mm,tikz]{standalone}
\usepackage{mwe}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[every node/.style={font=\tiny}]
\draw[dashed,fill=blue!20](1,0,-1) -- (-1,0,-1) -- (-1,0,0) -- (1,0,0) -- cycle;
\draw(-1,-1,0)node[anchor=south west]{$P_1$} -- (1,-1,0) -- (1,1,0) -- (-1,1,0) -- cycle;
\draw(1,0,1)node[anchor=south east]{$P_2$} -- (-1,0,1) -- (-1,0,0) -- (1,0,0) -- cycle;
\end{tikzpicture}
\end{document}