我写了以下代码:
\documentclass[margin=5mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{matrix,calc}
\begin{document}
\begin{tikzpicture}[every node/.style={anchor=north east,fill=white,minimum width=1.4cm,minimum height=7mm}]
\matrix (mA) [draw,matrix of math nodes]
{
(1,1,3) & (1,1,3) & (1,1,3) & (1,1,3) \\
(1,1,3) & (1,1,3) & (1,1,3) & (1,1,3) \\
(1,1,3) & (1,1,3) & (1,1,3) & (1,1,3) \\
(1,1,3) & (1,1,3) & (1,1,3) & (1,1,3) \\
};
\matrix (mB) [draw,matrix of math nodes] at ($(mA.south west)+(1.5,0.7)$)
{
(1,1,3) & (1,1,3) & (1,1,3) & (1,1,3) \\
(1,1,3) & (1,1,3) & (1,1,3) & (1,1,3) \\
(1,1,3) & (1,1,3) & (1,1,3) & (1,1,3) \\
(1,1,3) & (1,1,3) & (1,1,3) & (1,1,3) \\
};
\matrix (mC) [draw,matrix of math nodes] at ($(mB.south west)+(1.5,0.7)$)
{
(1,1,3) & (1,1,3) & (1,1,3) & (1,1,3) \\
(1,1,3) & (1,1,3) & (1,1,3) & (1,1,3) \\
(1,1,3) & (1,1,3) & (1,1,3) & (1,1,3) \\
(1,1,3) & (1,1,3) & (1,1,3) & (1,1,3) \\
};
\draw[dashed](mA.north east)--(mC.north east);
\draw[dashed](mA.north west)--(mC.north west);
\draw[dashed](mA.south east)--(mC.south east);
\end{tikzpicture}
\end{document}
生成下面的图像: ]1
如何在由虚线、底部矩阵和中间矩阵生成的左下三角形中添加一些点(例如使用 \dots)?
答案1
欢迎!矩阵内的节点自动获得名称。例如,矩阵中的节点mB
有名称mB-<row>-<column>
。这可以用作
\documentclass[margin=5mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{matrix,calc}
\begin{document}
\begin{tikzpicture}
\begin{scope}[every node/.style={anchor=north east,fill=white,minimum width=1.4cm,minimum height=7mm}]
\matrix (mA) [draw,matrix of math nodes]
{
(1,1,3) & (1,1,3) & (1,1,3) & (1,1,3) \\
(1,1,3) & (1,1,3) & (1,1,3) & (1,1,3) \\
(1,1,3) & (1,1,3) & (1,1,3) & (1,1,3) \\
(1,1,3) & (1,1,3) & (1,1,3) & (1,1,3) \\
};
\matrix (mB) [draw,matrix of math nodes] at ($(mA.south west)+(1.5,0.7)$)
{
(1,1,3) & (1,1,3) & (1,1,3) & (1,1,3) \\
(1,1,3) & (1,1,3) & (1,1,3) & (1,1,3) \\
(1,1,3) & (1,1,3) & (1,1,3) & (1,1,3) \\
(1,1,3) & (1,1,3) & (1,1,3) & (1,1,3) \\
};
\matrix (mC) [draw,matrix of math nodes] at ($(mB.south west)+(1.5,0.7)$)
{
(1,1,3) & (1,1,3) & (1,1,3) & (1,1,3) \\
(1,1,3) & (1,1,3) & (1,1,3) & (1,1,3) \\
(1,1,3) & (1,1,3) & (1,1,3) & (1,1,3) \\
(1,1,3) & (1,1,3) & (1,1,3) & (1,1,3) \\
};
\end{scope}
\draw[dashed](mA.north east)--(mC.north east);
\draw[dashed](mA.north west)--(mC.north west);
\draw[dashed](mA.south east)--(mC.south east);
\path (mB-4-2) -- (mB-4-3) node[midway,below=2em]{$\vdots$};
\end{tikzpicture}
\end{document}