这种图用tikz怎么画呢?

2020-04-06 16:52发布

![](https://yqfile.alicdn.com/329e8e7c7953fab0ca2178953fa0732abff89839.png) 这样的图片用tikz怎么画呢,能提示一下吗

![](https://yqfile.alicdn.com/329e8e7c7953fab0ca2178953fa0732abff89839.png) 这样的图片用tikz怎么画呢,能提示一下吗
3条回答
论坛 github.com/C
2020-04-06 22:28
提供另一种思路:使用三维坐标,自定义坐标轴的夹角,每次在特定平面里绘图。 ```tex \documentclass{article} \usepackage{tikz} \usetikzlibrary {3d} \begin{document} \begin{tikzpicture}[x={(10:10mm)}, z={(-30:10mm)}] \begin{scope}[->, above] \draw (0, 0) -- +(3, 0) node {x}; \draw (0, 0) -- +(0, 3) node {y}; \draw (0, 0, 0) -- +(0, 0, 3) node {z}; \end{scope} \foreach \i in {1, ..., 5} { \foreach \j in {1, ..., 5} { \draw (\i, \j) -- ++(1, 0) -- ++(0, 1) -- ++(-1, 0) -- cycle; } } \begin{scope}[canvas is xy plane at z=5] \foreach \i in {2, ..., 4} { \foreach \j in {2, ..., 4} { \draw (\i, \j) -- ++(1, 0) -- ++(0, 1) -- ++(-1, 0) -- cycle; } } \end{scope} \begin{scope}[canvas is xy plane at z=10] \foreach \i in {1, ..., 5} { \foreach \j in {1, ..., 5} { \draw (\i, \j) -- ++(1, 0) -- ++(0, 1) -- ++(-1, 0) -- cycle; \node[font=\sffamily, transform shape] at (\i+.5, \j+.5) {\i, \j}; } } \end{scope} \end{tikzpicture} \end{document} ``` ![](https://pics.latexstudio.net/data/images/202004/d962be711d82aeb.png)

一周热门 更多>