mirror of
https://github.com/MartinThoma/LaTeX-examples.git
synced 2025-04-26 06:48:04 +02:00
Added sigmoid-function
This commit is contained in:
parent
33ba7ff981
commit
5ea1d81eba
4 changed files with 68 additions and 0 deletions
34
tikz/sigmoid-function/sigmoid-function.tex
Normal file
34
tikz/sigmoid-function/sigmoid-function.tex
Normal file
|
@ -0,0 +1,34 @@
|
|||
\documentclass[varwidth=false, border=2pt]{standalone}
|
||||
|
||||
\usepackage{pgfplots}
|
||||
\usepackage{tikz}
|
||||
\usepackage{tkz-fct}
|
||||
\usetikzlibrary{arrows}
|
||||
|
||||
\begin{document}
|
||||
\begin{tikzpicture}
|
||||
\begin{axis}[
|
||||
legend pos=north west,
|
||||
axis x line=middle,
|
||||
axis y line=middle,
|
||||
grid = major,
|
||||
width=16cm,
|
||||
height=8cm,
|
||||
grid style={dashed, gray!30},
|
||||
xmin=-1, % start the diagram at this x-coordinate
|
||||
xmax= 1, % end the diagram at this x-coordinate
|
||||
ymin= 0, % start the diagram at this y-coordinate
|
||||
ymax= 1, % end the diagram at this y-coordinate
|
||||
%axis background/.style={fill=white},
|
||||
xlabel=x,
|
||||
ylabel=y,
|
||||
tick align=outside,
|
||||
enlargelimits=false]
|
||||
% plot the stirling-formulae
|
||||
\addplot[domain=-1:1, red, ultra thick,samples=500] {1/(1+exp(-5*x))};
|
||||
\addplot[domain=-1:1, blue, ultra thick,samples=500] {1/(1+exp(-10*x))};
|
||||
\addlegendentry{$f(x)=\frac{1}{1+e^{-5x}}$}
|
||||
\addlegendentry{$g(x)=\frac{1}{1+e^{-10x}}$}
|
||||
\end{axis}
|
||||
\end{tikzpicture}
|
||||
\end{document}
|
Loading…
Add table
Add a link
Reference in a new issue