改变条形图案密度

改变条形图案密度

我想改变条形的图案密度。这是我的代码

\documentclass{article}
\usepackage{tikz}
\usepackage{pgfplots}
\usepackage{pgfplotstable}
\usetikzlibrary{patterns}

\definecolor{ref}{rgb}{0.65,0.65,0.65} %{0.4,0.8,0.85}
\definecolor{lhmm}{rgb}{0.9,0.6,0.5}
\definecolor{ghmm}{rgb}{0.7,0.9,0.35}
\definecolor{lsvm}{rgb}{0.9,0.8,0.25}
\definecolor{gsvm}{rgb}{0.4,0.8,0.9}
\pgfplotsset{compat=1.9}

\begin{document}

\begin{tikzpicture}[font=\sffamily\scriptsize]
\pgfkeys{
    /pgf/number format/precision=1, 
    /pgf/number format/fixed zerofill=false
}
\begin{axis}[
  ybar,
  enlargelimits=0.15,
  bar width = .4cm,
scaled ticks = false,
tick label style={/pgf/number format/fixed},
  legend style={at={(0.5,1.15)},
  anchor=north,legend columns=-1},
  %xlabel={Demonstration},
  ylabel={Number of packets},
  width=0.9\linewidth,
  height=0.7\linewidth,
  symbolic x coords={50 Nodes,100 Nodes,200 Nodes,250 Nodes},
  xtick=data,
  %nodes near coords,
  nodes near coords align={vertical},
  every node near coord/.append style={color=black, rotate=90, anchor=center, font=\tiny, xshift=7, yshift=3}]
\addplot [fill=lhmm,postaction={pattern=north east lines}] coordinates {(50 Nodes,39226) (100 Nodes,99316) (200 Nodes,224504) (250 Nodes,281381)};
%\addplot [fill=lhmm] coordinates {(1,37.5)};
\addplot [fill=ghmm,,postaction={pattern= grid}] coordinates {(50 Nodes,38744) (100 Nodes,98041) (200 Nodes,221245) (250 Nodes,279543) };
\addplot [fill=lsvm,postaction={pattern=dots}]coordinates {(50 Nodes,56404) (100 Nodes,127799) (200 Nodes,277990) (250 Nodes,338844)};
%\addplot [fill=gsvm]coordinates {(1,87.5) (2, 100.0) (3, 100.0)};

\legend{LEACH,LEACH-MAC,Proposed}
\end{axis}
\end{tikzpicture}

\end{document}

相关内容