sigmoid-function.tex 1.1 KB

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