I draw a graph using the code below .

\documentclass[tikz]{standalone}
\usetikzlibrary{
shapes.geometric,
positioning,
fit,
calc,
patterns
}
\usepackage{tikz}
\usepackage{scalefnt}
\begin{document}
\pgfkeys{/tikz/.cd,
gradient style init/.initial=left color,
gradient style init/.get=\grsi,
gradient style init/.store in=\grsi,
gradient style end/.initial=right color,
gradient style end/.get=\grse,
gradient style end/.store in=\grse,
}
\tikzset{
block/.style = {circle, draw,
text width=1em,align=center,inner sep=0pt},
line/.style = {draw,thick,->},
oplus/.style={draw,circle, text width=1em,align=center,inner sep=0pt,
postaction={path picture={%
\draw[black]
(path picture bounding box.south west) -- (path picture bounding box.north east)
(path picture bounding box.north west) -- (path picture bounding box.south east);}}},
my pattern/.style args={#1 colored by #2}{%
path picture={
\node[pattern=#1,pattern color=#2] at (path picture bounding box.center) {};
}
},
my gradient/.style args={#1 and #2}{%
\grsi=#1,
\grse=#2,
},
}
\begin{tikzpicture}
\node [block,my pattern=north east lines colored by blue!50,
my gradient=orange!60 and yellow!40] (s13){13};
\end{tikzpicture}
\end{document}
However, when I put the graph into a big tree, there is only two blue lines inside the circle. May I know what's the problem. Is the blue line related to the size of the circle? Here is the new code:
\documentclass[tikz]{standalone}
\usetikzlibrary{
shapes.geometric,
positioning,
fit,
calc,
patterns
}
\usepackage{tikz}
\usepackage{scalefnt}
\begin{document}
\pgfkeys{/tikz/.cd,
gradient style init/.initial=left color,
gradient style init/.get=\grsi,
gradient style init/.store in=\grsi,
gradient style end/.initial=right color,
gradient style end/.get=\grse,
gradient style end/.store in=\grse,
}
\tikzset{
block/.style = {circle, draw,
text width=1em,align=center,inner sep=0pt},
line/.style = {draw,thick,->},
oplus/.style={draw,circle, text width=1em,align=center,inner sep=0pt,
postaction={path picture={%
\draw[black]
(path picture bounding box.south west) -- (path picture bounding box.north east)
(path picture bounding box.north west) -- (path picture bounding box.south east);}}},
my pattern/.style args={#1 colored by #2}{%
path picture={
\node[pattern=#1,pattern color=#2] at (path picture bounding box.center) {};
}
},
my gradient/.style args={#1 and #2}{%
\grsi=#1,
\grse=#2,
},
}
{\scalefont{0.5}
\begin{tikzpicture}[node distance=4mm]
\node [block] (s1) {1};
\node [block,below = of s1] (s2) {2};
\node [block, below = of s2] (s5) {5};
\node [block,below = of s5,my pattern=north east lines colored by blue!50,
my gradient=orange!60 and yellow!40] (s13){13};
\node [block, below = of s13] (s4) {4};
\end{tikzpicture}
}
\end{document}


positioninglibrary: what happens if you try something like\node [block,my pattern=north west lines colored by blue!50, my gradient=orange!60 and yellow!40,yshift=-5mm] (s13) at (s5.south){13};? – Claudio Fiandrino Feb 25 '13 at 09:03