Line is not perfectly horizontal in Commutative Diagram in Tikz
The \mathbb{B}_j
on the right is deeper than the \mathbb{B}
on the left, that is why the line is lower on the right. You can just add a \vphantom{_j}
to the node on the left to compensate for this.
\documentclass[border=2pt,tikz]{standalone}
\usetikzlibrary{matrix}
\usepackage{amssymb}
\begin{document}
\begin{tikzpicture}
\matrix (m)
[matrix of math nodes,row sep=4em,column sep=4em,minimum width=2em]
{
\mathbb{B}\vphantom{_j} & \mathbb{B}_j \\
& \mathbb B_{i} \\
};
\path[-stealth]
(m-1-1) edge node [above] {$h_{j}$} (m-1-2)
edge node [below] {$h_{i}$} (m-2-2)
(m-1-2) edge node [right] {$h_{\mathbb B_{i}, \mathbb B_{j}}$} (m-2-2);
\end{tikzpicture}
\end{document}
Also with node positioning
instead of \matrix
can look nicer:
\documentclass[border=2pt,tikz]{standalone}
\usetikzlibrary{positioning}
\usepackage{amssymb}
\begin{document}
\begin{tikzpicture}[node distance=1.5cm]
\node (b) {$\mathbb{B}$};
\node[right=of b] (bj) {$\mathbb{B}_j$};
\node[below=of bj] (bi) {$\mathbb{B}_i$};
\path[-stealth]
(b) edge node [above] {$h_{j}$} (bj)
edge node [below] {$h_{i}$} (bi)
(bj) edge node [right] {$h_{\mathbb B_{i}, \mathbb B_{j}}$} (bi);
\end{tikzpicture}
\end{document}
I suggest using tikz-cd
:
\documentclass{article}
\usepackage{amsmath,amssymb,tikz-cd}
\begin{document}
\[
\begin{tikzcd}
\mathbb{B} \arrow[r,"h_j"] \arrow[dr,swap,"h_i"] &
\mathbb{B}_j \arrow[d,"h_{\mathbb{B}_i,\mathbb{B}_j}"]
\\
& \mathbb{B}_i
\end{tikzcd}
\]
\end{document}
As was already mentioned, the problem is the text depth of the content of your nodes. One simple way of adjusting this is to reserve equal space for this in every node by specifying the text depth manually using the key text depth
:
\documentclass[tikz]{standalone}
\usepackage{amssymb}
\usetikzlibrary{matrix}
\begin{document}
\begin{tikzpicture}[
every node/.style={text depth=0.5pt}
]
\matrix (m)
[matrix of math nodes,row sep=4em,column sep=4em, minimum width=2em]
{
\mathbb B & \mathbb B_{j} \\
& \mathbb B_{i} \\
};
\path[-stealth]
(m-1-1) edge node [above] {$h_{j}$} (m-1-2)
edge node [below] {$h_{i}$} (m-2-2)
(m-1-2) edge node [right] {$h_{\mathbb B_{i}, \mathbb B_{j}}$} (m-2-2);
\end{tikzpicture}
\end{document}