在附图中,我们需要在虚线圆弧中加入“a”。以下是代码。
\begin{tikzpicture}
[scale=.9, auto=left, every node/. style={circle, fill=black!70, minimum size=0.1cm, inner sep=2pt]
\node (n1) at (0,0) {} ;
\node (n2) at (-1,1) {} ;
\node (n3) at (-1,0) {} ;
\node (n4) at (-1,-1) {} ;
\foreach \from / \to in {n1/n2, n1/n2, n1/n3, n1/n4}
\draw (\from) - - (\to);
\draw [line width =0.8pt, dotted] (n2) to bend[bend left=30] (n4);
\end{tikzpicture}
答案1
像这样?
\documentclass[tikz, margin=3mm]{standalone}
\usetikzlibrary{chains,
positioning,
quotes}
\begin{document}
\begin{tikzpicture}[
node distance = 9mm and 9mm,
start chain = going right,
dot/.style = {circle, fill=black!70, minimum size=1mm,
inner sep=2pt, outer sep=0pt,
node contents={}},
every edge quotes/.style={fill=white}
]
\foreach \x in {1,...,4}
\node (n\x) [dot, on chain, join=by -];
%
\node (n5) [dot, above=of n1];
\node (n6) [dot, below=of n1];
\draw (n5) -- (n2) (n6) -- (n2);
% arc
\draw[line width =0.8pt, dotted]
(n6) to [bend left=45, "$a$"] (n5);
\end{tikzpicture}
\end{document}
附录:
顶点上方带有标签:
\documentclass[tikz, margin=3mm]{standalone}
\usetikzlibrary{chains,
positioning,
quotes}
\begin{document}
\begin{tikzpicture}[
node distance = 9mm and 9mm,
start chain = going right,
dot/.style = {circle, fill=black!70, minimum size=1mm,
inner sep=2pt, outer sep=0pt,
node contents={}},
every label/.style = {inner sep=1pt, font=\footnotesize},
every edge quotes/.style={fill=white}
]
\foreach \x in {1,...,4}
\node (n\x) [dot, on chain, join=by -, label=$V_\x$];
%
\node (n5) [dot, above=of n1, label=$V_5$];
\node (n6) [dot, below=of n1, label=$V_6$];
\draw (n5) -- (n2) (n6) -- (n2);
% arc
\draw[line width =0.8pt, dotted]
(n6) to [bend left=45, "$a$"] (n5);
\end{tikzpicture}
\end{document}