Tikz-帮我清理这个图形?

Tikz-帮我清理这个图形?

我希望 w_{n-1} 标签显示在线下,并且 $\vodts$ 的间距更清晰。我该怎么做?

\documentclass{report}
\usepackage{graphicx}
\usepackage{tikz}
\usetikzlibrary{arrows,shapes, automata}
\begin{document}
\begin{tikzpicture}[shorten >=1pt,node distance=2cm,>=stealth',thick, thresh/.style={circle,fill=blue!20,draw,font=\sffamily\Large\bfseries}]
    \node[thresh] (1) {$\theta$};
    \coordinate[left of=1] (d2);
    \coordinate[below of=d2] (invis);
    \coordinate[above of=d2] (d1);
    \coordinate[below of=d2] (d3);
    \coordinate[right of=1] (outer);
    \draw [->] (1) to[in=60,out=90,loop] node[auto] {$w_n$} (1);
    \draw [->] (invis) to node[auto] {$\vdots$} (1);
    \draw [->] (d1) to[] node[auto] {$w_1$} (1);
    \draw [->] (d2) to node[auto] {$w_2$} (1);
    \draw [->] (d3) to node[in=260] {$w_{n-1}$} (1);
    \draw [->] (1) to node[auto] {$f(x_1, \ldots, x_n)$} ++ (3,0);
\end{tikzpicture}

\end{document}

答案1

这个怎么样?(不需要invis辅助坐标)

\usetikzlibrary{arrows,shapes, automata,calc}
\begin{tikzpicture}[shorten >=1pt,node distance=2cm,>=stealth',thick, thresh/.style={circle,fill=blue!20,draw,font=\sffamily\Large\bfseries}]
    \node[thresh] (1) {$\theta$};
    \coordinate[left of=1] (d2);
    \coordinate[above of=d2] (d1);
    \coordinate[below of=d2] (d3);
    \coordinate[right of=1] (outer);
    \draw [->] (1) to[in=60,out=90,loop] node[auto] {$w_n$} (1);
    \draw [->] (d1) to[] node[auto] {$w_1$} (1);
    \draw [->] (d2) to node[auto] (w2) {$w_2$} (1);
    \draw [->] (d3) to node[yshift=-1em,below] (wn1) {$w_{n-1}$} (1);
    \draw [->] (1) to node[auto] {$f(x_1, \ldots, x_n)$} ++ (3,0);

    % now the dots
    \foreach \i in {0.5, 0.6, 0.7} 
      \node at ($(wn1)!\i!(w2)$) {.};
\end{tikzpicture}

结果:

结果

相关内容