![如何使得下图中$\alpha_1,\alpha_2,\alpha_3$之间的垂直距离相同](https://linux22.com/image/360108/%E5%A6%82%E4%BD%95%E4%BD%BF%E5%BE%97%E4%B8%8B%E5%9B%BE%E4%B8%AD%24%5Calpha_1%2C%5Calpha_2%2C%5Calpha_3%24%E4%B9%8B%E9%97%B4%E7%9A%84%E5%9E%82%E7%9B%B4%E8%B7%9D%E7%A6%BB%E7%9B%B8%E5%90%8C.png)
看起来之间的垂直距离$\alpha_1,\alpha_2$
大于$\alpha_2,\alpha_3$
。我在下面发布了我的代码
\tikzset{%
mypoint/.style={circle, fill=black},
middlearrow/.style={% this code is from https://tex.stackexchange.com/a/39283/101651
decoration={markings,
mark= at position 0.5 with {\arrow[scale=2]{#1}} ,
},
postaction={decorate}
}
}
\begin{tikzpicture}
\matrix[column sep=2.5em, row sep=8ex, inner sep=0pt, minimum width=4pt] {%
%first row
\node (startrow1) {}; &&&
\node[mypoint, label={[above,yshift=2pt]$\binom{\alpha_3}{0}$}] (B1) {}; &&
\node[mypoint, label={[above,yshift=2pt]$\binom{\alpha_3}{1}$}] (B2) {}; &&
%\node[mypoint, label={[above,yshift=2pt]$\beta_{3}$}] (B3) {}; &&
\node[text width=3em, align=center] (endrow1) {$\alpha_3$};
\\
%second row
\node (startrow2) {}; &&
\node[mypoint, label={[below,yshift=-22pt] $\binom{\alpha_2}{0}$}] (A1) {}; &&
\node[mypoint, label={[below,yshift=-22pt] $\binom{\alpha_2}{1}$}] (A2) {}; &&
\node[mypoint, label={[below,yshift=-22pt] $\binom{\alpha_2}{2}$}] (A3) {}; &&
\node[text width=2.5em, align=center] (endrow2) {$\alpha_2$};
\\
%third row
\node (startrow3) {}; &
\node[mypoint, label={[below,yshift=-22pt]$\binom{\alpha_1}{0}$}] (C1) {}; &&
\node[mypoint, label={[below,yshift=-22pt]$\binom{\alpha_1}{1}$}] (C2) {}; &&
\node[mypoint, label={[below,yshift=-22pt]$\binom{\alpha_1}{2}$}] (C3) {}; &&
\node[mypoint, label={[below,yshift=-22pt]$\binom{\alpha_1}{3}$}] (C4) {}; &&
\node[text width=2.0em, align=center] (endrow3) {$\alpha_1$};
\\
};
\draw[dashed] (startrow1) -- (B1)
(B2) -- (endrow1)
(startrow2) -- (A1)
(A3) -- (endrow2)
(startrow3) -- (C1)
(C3) -- (endrow3);
\draw[middlearrow={<}] (B1) -- (B2);
% \draw[middlearrow={<}] (B2) -- (B3);
\draw[middlearrow={<}] (A1) -- (A2);
\draw[middlearrow={<}] (A2) -- (A3);
\draw[middlearrow={>}, dashed] (A1) -- (B1);
\draw[middlearrow={>}] (B1) -- (A2);
\draw[middlearrow={>}] (A2) -- (B2);
\draw[middlearrow={>}] (B2) -- (A3);
% \draw[middlearrow={>}, dashed] (A3) -- (B3);
\draw[middlearrow={<}] (C1) -- (C2);
\draw[middlearrow={<}] (C2) -- (C3);
\draw[middlearrow={<}] (C3) -- (C4);
\draw[middlearrow={>}, dashed] (C1) -- (A1);
\draw[middlearrow={<}] (C2) -- (A1);
\draw[middlearrow={<}] (C2) -- (A2);
\draw[middlearrow={<}] (A2) -- (C3);
\draw[middlearrow={<}] (C3) -- (A3);
\draw[middlearrow={>}, dashed] (A3) -- (C4);
\end{tikzpicture}
答案1
节点完成后,列和行之间的距离是固定的。然后由于第二行节点下方包含标签,因此第三行点放置8ex
在标签下方,而不是第二行点下方。
您可以先绘制点矩阵,然后添加二项式标签,或者phantom
在第一行包含一个标签以强制行之间的距离相似,如下面的代码所示:
\documentclass[tikz,border=2mm]{standalone}
\usetikzlibrary{positioning, matrix, decorations.markings}
\usepackage{mathtools}
\begin{document}
\begin{tikzpicture}[%
mypoint/.style={circle, fill=black},
middlearrow/.style={% this code is from https://tex.stackexchange.com/a/39283/101651
decoration={markings,
mark= at position 0.5 with {\arrow[scale=2]{#1}} ,
},
postaction={decorate}
}
]
\matrix[column sep=2.5em, row sep=8ex, inner sep=0pt, minimum width=4pt] {%
%first row
\node (startrow1) {}; &&&
\node[mypoint, label={[above,yshift=2pt]$\binom{\alpha_3}{0}$},
label={[below,yshift=-22pt] \phantom{$\binom{\alpha_2}{0}$}}] (B1) {}; &&
\node[mypoint, label={[above,yshift=2pt]$\binom{\alpha_3}{1}$}] (B2) {}; &&
%\node[mypoint, label={[above,yshift=2pt]$\beta_{3}$}] (B3) {}; &&
\node[text width=3em, align=center] (endrow1) {$\alpha_3$};
\\
%second row
\node (startrow2) {}; &&
\node[mypoint, label={[below,yshift=-22pt] $\binom{\alpha_2}{0}$}] (A1) {}; &&
\node[mypoint, label={[below,yshift=-22pt] $\binom{\alpha_2}{1}$}] (A2) {}; &&
\node[mypoint, label={[below,yshift=-22pt] $\binom{\alpha_2}{2}$}] (A3) {}; &&
\node[text width=2.5em, align=center] (endrow2) {$\alpha_2$};
\\
%third row
\node (startrow3) {}; &
\node[mypoint, label={[below,yshift=-22pt]$\binom{\alpha_1}{0}$}] (C1) {}; &&
\node[mypoint, label={[below,yshift=-22pt]$\binom{\alpha_1}{1}$}] (C2) {}; &&
\node[mypoint, label={[below,yshift=-22pt]$\binom{\alpha_1}{2}$}] (C3) {}; &&
\node[mypoint, label={[below,yshift=-22pt]$\binom{\alpha_1}{3}$}] (C4) {}; &&
\node[text width=2.0em, align=center] (endrow3) {$\alpha_1$};
\\
};
\draw[dashed] (startrow1) -- (B1)
(B2) -- (endrow1)
(startrow2) -- (A1)
(A3) -- (endrow2)
(startrow3) -- (C1)
(C3) -- (endrow3);
\draw[middlearrow={<}] (B1) -- (B2);
% \draw[middlearrow={<}] (B2) -- (B3);
\draw[middlearrow={<}] (A1) -- (A2);
\draw[middlearrow={<}] (A2) -- (A3);
\draw[middlearrow={>}, dashed] (A1) -- (B1);
\draw[middlearrow={>}] (B1) -- (A2);
\draw[middlearrow={>}] (A2) -- (B2);
\draw[middlearrow={>}] (B2) -- (A3);
% \draw[middlearrow={>}, dashed] (A3) -- (B3);
\draw[middlearrow={<}] (C1) -- (C2);
\draw[middlearrow={<}] (C2) -- (C3);
\draw[middlearrow={<}] (C3) -- (C4);
\draw[middlearrow={>}, dashed] (C1) -- (A1);
\draw[middlearrow={<}] (C2) -- (A1);
\draw[middlearrow={<}] (C2) -- (A2);
\draw[middlearrow={<}] (A2) -- (C3);
\draw[middlearrow={<}] (C3) -- (A3);
\draw[middlearrow={>}, dashed] (A3) -- (C4);
\end{tikzpicture}
\end{document}
答案2
问题似乎与点的标签有关。您可以yshift=-27pt
对第一行中的所有点使用 (也许可以稍微调整 的值yshift
)。这样,第一行的标签将出现在点下方,并且 α₁,α₂ 和 α₂,α₃ 之间的空间将相等。