figure-derivative2.tex 1.41 KB
Newer Older
孟霞 committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
%%%------------------------------------------------------------------------------------------------------------
\begin{tikzpicture}
\begin{axis}[  
  name=tanh,
  width=6cm, height=4.5cm, 
  xtick={-5,-2.5,...,6},
  ytick={-1.0,-0.5,0,0.5,1.0},
  xlabel={$x$},
  ylabel={$y$},
  xlabel style={xshift=2.4cm,yshift=2.5cm},
  axis y line=middle,%y轴居中
  ylabel style={xshift=0.1cm,yshift=0cm},
  x axis line style={->},%x轴箭头
  axis line style={very thick},
  axis x line*=middle,%将上面的x轴去掉,仅保留下面的x轴
  xmin=-6,
  xmax=6,
  ymin=-1.2,
  ymax=1.2]
\addplot[draw=red,very thick]{tanh(x)};
\end{axis}
\node [anchor=north] (labelc) at (2.3,-0.5) {\footnotesize{(a)}};
\begin{axis}[  
  at={(tanh.east)},
  anchor=east, 
  xshift=6cm,
  yshift=0cm, 
  width=6cm, height=4.5cm, 
  xtick={-10,-5,...,10},
  ytick={0,0.5,1},
  xlabel={$x$},
  ylabel={$y$},
  xlabel style={xshift=2.4cm,yshift=0.7cm},
  axis y line=middle,%y轴居中
  ylabel style={xshift=0.1cm,yshift=0cm},
  x axis line style={->},%x轴箭头
  axis line style={very thick},
  axis x line*=bottom,%将上面的x轴去掉,仅保留下面的x轴
  xmin=-10,
  xmax=10,
  ymin=0,
  ymax=1.2]
\addplot[draw=ublue,very thick]{1-tanh(x)*tanh(x)};
\end{axis}
\node [anchor=north] (labelc) at (8.2,-0.5) {\footnotesize{(b)}};
\end{tikzpicture}
%%%------------------------------------------------------------------------------------------------------------