如何从内部和外部对圆圈进行编号,例如,我需要将绿色圆圈从内部编号为 1、2、3,从外部编号为 user1、user2、user3。
\documentclass{article}
\usepackage{tikz}
\begin{document}
\pagestyle{empty}
\def\layersep{3 cm}
\begin{tikzpicture}[shorten >=1pt,->,draw=black!50, node distance=\layersep]
\tikzstyle{every pin edge}=[<-,shorten <=1pt]
\tikzstyle{neuron}=[circle,fill=black!25,minimum size=17pt,inner sep=0pt]
\tikzstyle{input neuron}=[neuron, fill=green!50];
\tikzstyle{hidden neuron}=[neuron, fill=red!50];
\tikzstyle{annot} = [text width=4em, text centered]
% Draw the input layer nodes
% This is the same as writing \foreach \name / \y in {1/1,2/2,3/3,4/4}
\foreach \name / \y in {1,...,3}
\path[yshift=0.5cm]
node[input neuron] (I-\name) at (0,-\y cm) {};
% Draw the hidden layer nodes
\foreach \name / \y in {1,...,6}
\path[yshift=0.5cm]
node[hidden neuron] (H-\name) at (\layersep,-\y cm) {};
% Connect every node in the input layer with every node in the
% hidden layer.
\foreach \source in {1,...,3}
\foreach \dest in {1,...,6}
\path (I-\source) edge (H-\dest);
% Annotate the layers
\node[annot,above of=H-1, node distance=1cm] (hl) {SCs};
\node[annot,left of=hl] {Users};
\end{tikzpicture}
% End of code
\end{document}