如何使用 tikz 绘制矩阵结构组织图?
应该是这样的。不完全一样,只是用来描绘框在二维空间中相互交叉的轮廓(即不必具有相同的线型、大小等)。
我已经尝试过仅定位节点,但担心它不会起作用 - 即使起作用,它可能会非常混乱。
\documentclass[border=5pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{positioning}
\begin{document}
\begin{tikzpicture}
\tikzstyle{box} = [draw=black,fill=none]
\node[box] (a) {Top management};
\node[box,below=1cm of a] (b) {Section leader};
\node[box,right=1cm of b] (c) {Section leader};
\node[box,left=1cm of b] (d) {Section leader};
\node[box,below=1cm of b] (e) {};
\node[box,below=1cm of c] (f) {};
\node[box,below=1cm of d] (g) {};
\node[box,left=1cm of g] (h) {Section leader};
\node[box,below=1cm of h] (i) {Section leader};
\node[box,below=1cm of i] (j) {Section leader};
\end{tikzpicture}
\end{document}
答案1
类似这样的事?我部分遵循了你的代码,大部分遵循了你的草图……
\documentclass[border=5pt,
tikz]{standalone}
\usetikzlibrary{arrows.meta,chains,positioning,shadows}
\begin{document}
\begin{tikzpicture}[
node distance = 3mm,
start chain = 1 going right,
start chain = 2 going below,
box/.style = {draw=black, align=left, on chain=1}
]
\node[box] (b) {Section leader 1};
\node[box] (c) {Section leader 2};
\node[box] (d) {Section leader 3};
\node[box,above=8mm of c] (a) {Top management};
%
\begin{scope}[box/.append style={on chain=2}]
\node[box,below left=of b] (h) {Section\\ leader 4};
\node[box] (i) {Section\\ leader 5};
\node[box] (j) {Section\\ leader 6};
\end{scope}
% arrows
\draw (a) -- (c) (b.north) -- + (0,4mm) -| (d);
\draw[draw=gray,line width=1mm, -{Triangle[fill=gray,length=2mm]}]
(b) edge (j.south -| b) (c) edge (j.south -| c) (d) edge (j.south -| d)
(h) edge (d.east |- h) (i) edge (d.east |- i) (j) edge (d.east |- j);
\end{tikzpicture}
\end{document}