2

Can I creating graph like this or something like this in Latex? enter image description here

1
  • 2
    look up the pgfplots package
    – daleif
    Commented Sep 30, 2022 at 6:29

1 Answer 1

10

Something to start with. Have a look at the pgfmanual, or a minimal introduction to tikz for more details.

\documentclass{article}
\usepackage{tikz}
\usepackage{pgfplots}

\begin{document}
    \begin{tikzpicture}[>=latex]
        \draw [ultra thin, gray] (-1,0) grid [step=1] (4,4);
        \draw [->] (0,0) -- (5,0) node [right] {$x$};
        \draw [->] (0,0) -- (0,5) node [above] {$y$};
        
        \draw [thick, red, <->] plot [domain=-1:3] (\x,{(\x-1)^2}) node [above] {$f(x)$};
        \draw [thick, blue, <->] plot [domain=-0.5:1.5] (\x,{(2*\x-1)^2}) node [above] {$f(2x)$};
        
        \draw [->] (2.5,3) -- (1.5,3);
        \draw [->] (-0.8,3.5) -- (-0.5,3.5);
    \end{tikzpicture}
\end{document}

enter image description here

You must log in to answer this question.

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