figure-Self-information-function.tex 802 Bytes
Newer Older
曹润柘 committed
1 2 3 4 5
\definecolor{ublue}{rgb}{0.152,0.250,0.545}
\begin{tikzpicture}
\begin{axis}[
  width=12cm,
  height=4cm,
曹润柘 committed
6 7 8
  xlabel={{$\textrm{P}(x)$}},
  ylabel={{$\textrm{I}(x)$}},
  ylabel style={yshift=-1.5em,font=\footnotesize},
xiaotong committed
9
  xlabel style={yshift=0.3em,font=\footnotesize},
曹润柘 committed
10
  xtick={0,0.2,...,1.0},
xiaotong committed
11 12 13 14
  ytick={0,8},
  y tick style={opacity=0},
  x tick style={opacity=0},
  domain=0.01:1,
曹润柘 committed
15 16 17 18 19 20
  enlarge x limits=true,
  enlarge y limits={upper},
  legend style={draw=none},
  xmin=0,
  xmax=1,
  ymin=0,
xiaotong committed
21
  ymax=8,
曹润柘 committed
22 23
xticklabel style={font=\small}, %坐标轴字体大小
yticklabel style={font=\small}
曹润柘 committed
24
]
xiaotong committed
25 26
\addplot[draw=ublue,samples=100,thick] {-log2(x)};
\legend{\footnotesize{$\textrm{I}(x) = -\log \textrm{P}(x)$}}
曹润柘 committed
27 28 29 30
\end{axis}
\end{tikzpicture}

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