Can anyone plot the function
for me as in the screenshot blew ?
I need help, I can not even know how to start or to build a MWE.
Can anyone plot the function
for me as in the screenshot blew ?
I need help, I can not even know how to start or to build a MWE.
Note that you have to start at some point >0 since exp(-1/x) is undefined at x=0.
\documentclass{standalone}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}[axis lines=center,domain=-1:1.75,xlabel={$t$},
ymin=-.1,% to prevent line getting cropped at y=0
height=4cm,width=8cm]
\addplot[samples=2,dashed] {1};
\addplot[domain=-1:0.001,samples=2,color=black,ultra thick] {0};
\addplot[domain=0.001:1.5,samples=50,color=black,ultra thick] {exp(-1/x};
\end{axis}
\end{tikzpicture}%
\end{document}
{(x<=0)*0 + (x>0)*exp(-1/x)}. This skips x=0. For evaluation in more than two domains see here: http://tex.stackexchange.com/q/182505.
– Ross
Dec 03 '16 at 06:29
pgfplots piecewise defined function– cmhughes Dec 02 '16 at 20:40