3

How can I draw this function in LaTeX?

enter image description here

enter image description here

Edit: i did something good but fig 1 does not work how i want

%---------------------------FIGURE 1-------------------------------------------\begin{center}
\begin{tikzpicture}
        %----------------------ASSSI---------------------
        \draw[thick,->] (0,0) -- (4,0) node[anchor=north west] {tempo};
        \draw[thick,->] (0,0) -- (0,4) node[anchor=south east] {velocità};
        %---------------------- MOTO --------------------  
        \draw[smooth, domain=0:4,thick] 
        plot (\x,{exp(-\x)}) node [right]{};
\end{tikzpicture}
\end{center}

%----------------------------- END FIGURE 1----------------------------------------------
%----------------------------- FIGURE 2--------------------------------------------------

\begin{center}
\begin{tikzpicture}
        %----------------------ASSSI---------------------
        \draw[thick,->] (0.33,0) -- (4.33,0) node[anchor=north west] {tempo};
        \draw[thick,->] (0.33,0) -- (0.33,4) node[anchor=south east] {posizione};
        %---------------------- MOTO --------------------  
        \draw[smooth, domain=0.335:4,thick] 
        plot (\x,{3-(1/(\x))}) node [right]{};
\end{tikzpicture}
\end{center}
%----------------------------END FIGURE 2----------------------------------------------
4
  • Welcome to TeX SX! Do you have the formulæ for these functions?
    – Bernard
    Mar 15, 2021 at 9:27
  • 1
    If you have the function you can try it with this answer here: Graphing Equations in Overleaf
    – Roland
    Mar 15, 2021 at 9:46
  • What exactly in figure 1 is wrong? Be specific please so that we can help fix the specific problem. Is figure 2 OK?
    – Elad Den
    Mar 15, 2021 at 11:23
  • Figure 2 is Ok, figure 1 i want that the function starts higher in y axe
    – Livoree
    Mar 15, 2021 at 11:28

1 Answer 1

5

enter image description here

\documentclass[varwidth,
               border=3.141592]{standalone}
\usepackage{tikz}

\begin{document}

\begin{tikzpicture}
% ASSSI
\draw[<->] (0,4) -- node[left] {tempo}      (0,0) 
                 -- node[below] {velocità}  (4,0);
% MOTO 
\draw[domain=0:3.5, samples=31, thick] plot (\x,{3*exp(-\x)});
\end{tikzpicture}


\begin{tikzpicture}
% ASSSI
\draw[<->] (0,4) -- node[left]  {tempo}     (0,0)
                 -- node[below] {posizione} (4,0);
% MOTO
\draw[domain=0:3.5, samples=31, thick] plot (\x, {3-3*exp(-\x)}); % <--- corrected
\end{tikzpicture}

\end{document}
3
  • Thank you a lot, I cant upvote at the moment becouse i haven't enought reputaton but i will when i can.
    – Livoree
    Mar 15, 2021 at 13:46
  • @Livoree, no problem, however, if you liked you can already accept answer ;-)
    – Zarko
    Mar 15, 2021 at 14:08
  • Done , ty again :)
    – Livoree
    Mar 15, 2021 at 14:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .