I'm drawing graphs in which I want to label vertices (e.g. x, y, z, w, etc), but also attach the value of a function calculated at each vertex (e.g. 4, -3, 2, 7 corresponding to vertices x, y, z, w etc). I'd like to achieve this by having x inside the vertex and the value of the function on the outside, though if there are other ways of achieving this easily I'd be open to that.
Is it possible to use the tkz-graph package to achieve this? I have read the documentation and (notwithstanding that my French is very rusty), I haven't been able to figure this out. Also open to alternative (simple & easy) packages that would allow me to achieve this.
(My level of LaTeX is $< \epsilon$)
\documentclass[10pt,border=3mm,tikz]{standalone}
\usepackage{tkz-graph}
\begin{document}
\begin{tikzpicture}
\GraphInit[vstyle=Normal]
\SetGraphUnit{2}
\SetVertexMath
\Vertex{x}
\Vertex[LabelOut, L=$4$, Lpos=90]{x} % this just replaces the internal label doesn't add an outside label
\EA(x){y}
\NOEA(y){z}
\SOEA(z){w}
\Edges(x,y,z,w,y,z)
\end{tikzpicture}
\end{document}


tikz, and instead relying on the packages built on top, liketkz-graphandtikz-cd, as my focus is studying maths rather than LaTeX, but it looks like I'm going to have to studytikz. – Sharanjit Nov 25 '23 at 13:57