sigmoid-function.tex 1.0 KB

123456789101112131415161718192021222324252627282930313233
  1. \documentclass[varwidth=false, border=2pt]{standalone}
  2. \usepackage{pgfplots}
  3. \usepackage{tikz}
  4. \begin{document}
  5. \begin{tikzpicture}
  6. \begin{axis}[
  7. legend pos=north west,
  8. axis x line=middle,
  9. axis y line=middle,
  10. grid = major,
  11. width=16cm,
  12. height=8cm,
  13. grid style={dashed, gray!30},
  14. xmin=-1, % start the diagram at this x-coordinate
  15. xmax= 1, % end the diagram at this x-coordinate
  16. ymin= 0, % start the diagram at this y-coordinate
  17. ymax= 1, % end the diagram at this y-coordinate
  18. %axis background/.style={fill=white},
  19. xlabel=x,
  20. ylabel=y,
  21. tick align=outside,
  22. enlargelimits=false]
  23. % plot the stirling-formulae
  24. \addplot[domain=-1:1, red, ultra thick,samples=500] {1/(1+exp(-5*x))};
  25. \addplot[domain=-1:1, blue, ultra thick,samples=500] {1/(1+exp(-10*x))};
  26. \addlegendentry{$f(x)=\frac{1}{1+e^{-5x}}$}
  27. \addlegendentry{$g(x)=\frac{1}{1+e^{-10x}}$}
  28. \end{axis}
  29. \end{tikzpicture}
  30. \end{document}