如何绘制具有多个元素的顶点

如何绘制具有多个元素的顶点

我正在尝试绘制具有多个内部顶点的某个图形,但我不明白,有人可以帮我吗?

在此处输入图片描述

\begin{figure}[H]
    \centering
    \scalebox{1}{
        \begin{tikzpicture}[scale = 1]
            \tikzstyle{every state}=[fill opacity=0.5,text opacity=1,semithick,minimum size=10pt]
            \tikzset{roundnode/.style={thick, draw = black, fill = white, outer sep = 1.5, circle, minimum size = 10pt, scale = 0.75}}
            
            \node[roundnode = black] (1) at (4, 7){a};
            \node[roundnode = black] (2) at (3, 6){b};
            \node[roundnode = black] (3) at (5, 6){c};
            \node[roundnode = black] (4) at (5, 4){e};
            \node[roundnode = black] (5) at (8, 6){d};
            \node[roundnode = black] (6) at (8, 4){f};
            \node[roundnode = black] (7) at (9, 5){h};
            \node[roundnode = black] (8) at (9, 3){g};
            \node[roundnode = black] (9) at (11, 5){i};
            \node[roundnode = black] (10) at (12, 6){j};
            \node[roundnode = black] (11) at (12, 4){k};
            
            \draw
            (1) edge[-,thick]   (2)
            (2) edge[-,thick]   (3)
            (3) edge[-,thick]   (1)
            (3) edge[-,thick]   (4)
            (3) edge[-,thick]   (5)
            (4) edge[-,thick]   (6)
            (3) edge[-,thick]   (1)
            (5) edge[-,thick]   (7)
            (7) edge[-,thick]   (6)
            (6) edge[-,thick]   (8)
            (7) edge[-,thick]   (9)
            (9) edge[-,thick]   (10)
            (9) edge[-,thick]   (11)
            ;
            %(3) edge[-,thick]   (4);
           
        \end{tikzpicture}
    }
\end{figure}

答案1

这符合你的目的吗?

\documentclass[border=2pt, tikz]{standalone}

\usepackage{tikz}

\begin{document}
    
    \begin{tikzpicture}[scale=1]
        \tikzstyle{every state}=[
                        fill opacity=0.5,
                        text opacity=1,
                        semithick,
                        minimum size=10pt
                        ]
        \tikzset{roundnode/.style={
                thick, 
                draw=black, 
                fill=white, 
                inner sep=1pt,
                circle, 
                minimum size=1cm, 
                scale=0.75}
            }
        
        \node[roundnode = black] (1) at (0,0){a b c};
        \node[roundnode = black] (2) at (1,0){c d e};
        \node[roundnode = black] (3) at (2,0){d e f};
        \node[roundnode = black] (4) at (2,-1){f g};
        \node[roundnode = black] (5) at (3,0){d f h};
        \node[roundnode = black] (6) at (4,0){h i};
        \node[roundnode = black] (7) at (4.5,1){i j};
        \node[roundnode = black] (8) at (4.5,-1){i k};
        
        \draw
        (1) edge[-,thick]   (2)
        (2) edge[-,thick]   (3)
        (3) edge[-,thick]   (4)
        (3) edge[-,thick]   (5)
        (5) edge[-,thick]   (6)
        (6) edge[-,thick]   (7)
        (6) edge[-,thick]   (8);
    \end{tikzpicture}
\end{document}

在此处输入图片描述

相关内容