Plot graph for cut-off

How can I plot a function like this with LaTeX?

But without being pointy (i.e. a smooth transition) and the function never reaching zero?

Here is my code:

\begin{figure}[H]

\centering
\begin{tikzpicture}
\begin{axis}[
xmin=0, xmax=1,
xtick=\empty, % remove all ticks from x-axis
ytick={0,1}, % remove all ticks from y-axis
xlabel=$\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ t_{mix}(\varepsilon) \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ t$,
ylabel=\empty,
axis lines=left, % default is to make a box around the axis
samples = 100,
domain=0:5,
restrict y to domain=-0:1,
legend pos=north east
]
\addplot [black, samples = 100] {(x<0.638585)*(1 - exp(7*x)/100) + (!(x<0.638585))*(exp(-7* (x - 0.5))/3)};
\addlegendentry{$d(t)$}
\addplot [green, samples = 100] {(4)^(-1)};
\addlegendentry{$\varepsilon$}
\draw [dashed] (0.61678,-1) -- (0.61678,1);
\end{axis}
\end{tikzpicture}
\end{figure}


\documentclass[border=1cm]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.18}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
xmin=0, xmax=1,
ymin=0, ymax=1.05,
xtick={ln(75)/7},
xticklabels={$t_{mix}(\varepsilon)$},
ytick=\empty,
xlabel={$t$},
x label style={at={(axis description cs:1,0)}},
axis lines=left,
]
\addlegendentry{$d(t)$}
\addlegendentry{$\varepsilon$}
\draw[dashed] ({ln(75)/7},0) -- (({ln(75)/7},1);
\end{axis}
\end{tikzpicture}
\end{document}


• Thank you for the solution (and for improving some things in my previous one, I don't really know that well how to handle with plots on overleaf) Commented Nov 22, 2021 at 19:23
• This is a graph made with PGFPlots in LaTeX. overleaf.com is just a website where you can write and compile LaTeX online. Commented Nov 22, 2021 at 19:44
• @hpekristiansen, in case you are interested: Have a look at my answer for an improved version of your answer. Commented Nov 23, 2021 at 6:39

This is just an improved version of hpekristiansen's answer which is too long for a comment.

The main "issue" with the answer is, that way too many points are calculated. As you can see one can get the same result with only 25 points (instead of 500). For more details please have a look at the comments in the code.

% used PGFPlots v1.18.1
\documentclass[border=5pt]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.18}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
xmin=0, xmax=1,
ymin=0, ymax=1.05,
xtick={ln(75)/7},
% ("mix" should be upright)
xticklabels={$t_{\mathrm{mix}}(\varepsilon)$},
ytick=\empty,
xlabel={$t$},
% (even better coordinate system to choose to place the xlabel)
x label style={at={(xticklabel* cs:1)}},
axis lines=left,
% ---------------------------------------------------------------------
% moved common stuff here
% ---------------------------------------------------------------------
smooth,
% only this domain is shown, so no need to calculate the default
% domain which is from -5 to +5 ...
domain=0:1,
% ... with that the default number of samples (25) is enough
% to have a smooth plot (when smooth is used as well)
%        samples=25,
% don't show any markers
no markers,
% ---------------------------------------------------------------------
]
\addplot {x<0.63 ? 1-exp(7*x)/100 : exp(-20*(x-0.545))};
\addlegendentry{$d(t)$}
\addlegendentry{$\varepsilon$}

• Great improvements. I especially learned to always give a domain - there is no such thing as adopting xmin and xmax when domain is missing. Personally, I would not move "common stuff" to axis from a few plots. Commented Nov 23, 2021 at 12:40
• @hpekristiansen, thanks for the credit. As always everything has pros and cons. But most often I would say it would be benefitial to place at least domain in the axis options to avoid repetition. Here a link to a random answer I gave here on TeX.SX on how I usually deal with stating xmin and xmax values without repeating myself. tex.stackexchange.com/a/490635/95441 Commented Nov 23, 2021 at 13:11