figure-no-smoothing&smoothed-probability-distributions.tex 1.4 KB
Newer Older
1
\definecolor{ublue}{rgb}{0.152,0.250,0.545}
2
\begin{tikzpicture}
3
\begin{axis}[  
单韦乔 committed
4
  width=12cm, height=4.5cm, 
5 6
  symbolic x coords={未抽取词,do,want,what,am,people,look},
  xtick=data,
7 8 9
  ytick={0,0.05,0.1,0.15,0.2,0.25},
  xlabel={低概率词汇},
  ylabel={词汇概率},
10
  legend pos=outer north east,
单韦乔 committed
11
  xlabel style={align=right,xshift=6.5cm,yshift=0.8cm,font=\footnotesize},
12
  ylabel style={rotate=-90,yshift=2cm,xshift=1cm,font=\footnotesize},
13 14
  y tick style={opacity=0},
  x tick style={opacity=0},
15
  x tick label style={anchor=base,font=\footnotesize,yshift=-0.5cm},
16 17 18 19 20 21 22 23
  y tick label style={font=\footnotesize,/pgf/number format/.cd,fixed,precision=2},
  y axis line style={opacity=0},
  tick align=inside,
  ymajorgrids,
  axis x line*=bottom,
  major grid style={dotted,draw=ublue},
  axis on top,
  legend style={anchor=north west,font=\footnotesize},
24 25
  ymin=0,
  ymax=0.25]
26
  \addplot [ybar,bar shift=-2mm,bar width=4mm,fill=blue!40,draw=blue!40,area legend] coordinates{(未抽取词,0) (do,0.05) (want,0.05) (what,0.05) (am,0.1) (people,0.15) (look,0.2)};
单韦乔 committed
27
  \addplot [ybar,bar shift=2.15mm,bar width=4mm,fill=red!40,draw=red!40,area legend] coordinates{(未抽取词,0.03) (do,0.062) (want,0.062) (what,0.062) (am,0.09) (people,0.122) (look,0.138)};
28
  \legend{未平滑,平滑后}
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
\end{axis}
\end{tikzpicture}

%---------------------------------------------------------------------