![如何删除 TIKZ 中顶点和边之间的空间?](https://linux22.com/image/455359/%E5%A6%82%E4%BD%95%E5%88%A0%E9%99%A4%20TIKZ%20%E4%B8%AD%E9%A1%B6%E7%82%B9%E5%92%8C%E8%BE%B9%E4%B9%8B%E9%97%B4%E7%9A%84%E7%A9%BA%E9%97%B4%EF%BC%9F.png)
我有以下代码来获取一个包含两个节点 $v_1$ 和 $v_2$ 以及 $v_1$ 和 $v_2$ 之间的边的图。
\tikzstyle{place}=[circle,minimum size=1mm,
inner sep=0pt, outer sep=0pt,fill=black,thick]
\begin{tikzpicture}[shorten >=1pt,node distance=3cm,auto]
\node[place,label=above:$v_1$] (v1) at (0,0) {};
\node[place,label=above:$v_2$] (v2) at (1,0) {};
\draw [-] (v1) -- (v2);
\end{tikzpicture}
答案1
\documentclass[tikz, border=1cm]{standalone}
\tikzset{
place/.style={circle, minimum size=1mm,
inner sep=0pt, outer sep=0pt, fill
}}
\begin{document}
\begin{tikzpicture}
\node[place, label=above:$v_1$] (v1) at (0,0) {};
\node[place, label=above:$v_2$] (v2) at (1,0) {};
\draw (v1) -- (v2);
\end{tikzpicture}
\end{document}