The following code shows an ugly way to fix the bad vertical positioning of the labels in a top-down phylogenetic graph. How to avoid the special fixing style done by hand? How to find the good style to be fixed?
% Source: https://tex.stackexchange.com/a/133237/6880
\documentclass[12 pt]{article}
\usepackage{tikz}
\usetikzlibrary{graphs, graphdrawing}
\usegdlibrary{phylogenetics}
\pgfgdset{
phylogenetic inner node/.style = {
/tikz/.cd,
draw, circle,
inner sep=0pt,
minimum size=5pt
}
}
\begin{document}
\begin{tikzpicture}
\graph[
phylogenetic tree layout,
upgma,
distance matrix = {
% a b c d e f g
0 4 9 9 9 9 9 % a
4 0 9 9 9 9 9 % b
9 9 0 2 7 7 7 % c
9 9 2 0 7 7 7 % d
9 9 7 7 0 3 5 % e
9 9 7 7 3 0 5 % f
9 9 7 7 5 5 0 % g
}]
{ a, b, c, d, e, f, g };
\end{tikzpicture}
\begin{tikzpicture}[
test/.append style={font=\vphantom{Vg}}
]
\graph[
phylogenetic tree layout,
upgma,
distance matrix = {
% a b c d e f g
0 4 9 9 9 9 9 % a
4 0 9 9 9 9 9 % b
9 9 0 2 7 7 7 % c
9 9 2 0 7 7 7 % d
9 9 7 7 0 3 5 % e
9 9 7 7 3 0 5 % f
9 9 7 7 5 5 0 % g
}]
{ a[test], b[test], c[test], d[test], e[test], f[test], g[test] };
\end{tikzpicture}
\end{document}





\begin{tikzpicture}[every node/.style={text height=1.25ex}] ... \end{tikzpicture}does the job. Thanks. – projetmbc Feb 21 '23 at 19:48text heightandtext depthhelps in this case. – Jasper Habicht Feb 21 '23 at 19:51