[latex tikz]画无向图的例子

xiaoxiao2021-02-28  68

%Tikz画图 \usepackage{tikz} \usetikzlibrary{arrows,graphs} %指明是图库 \begin{tikzpicture}[> = stealth, % arrow head style shorten > = 1pt, % don't touch arrow head to node auto, node distance = 3cm, % distance between nodes semithick % line style ,scale=.8,auto=left,every node/.style={circle,fill=blue!20}] \node (n1) at (0,0) {1}; \node (n2) at (0,-2) {2}; \node (n3) at (0,-4) {3}; \node (n4) at (0,-6) {4}; \node (n5) at (0,-8) {5}; \draw (n1)--(n2); \draw (n2)--(n3); \draw (n3)--(n4); \draw [red,very thick](n4)--(n5); \draw [red,very thick] (n1) .. controls (-2,-2.5) ..(n4); \draw [red,very thick](n1) .. controls (2,-3.5) ..(n5); \end{tikzpicture}
转载请注明原文地址: https://www.6miu.com/read-64993.html

最新回复(0)