TransWikia.com

Graphing Equations in Overleaf

TeX - LaTeX Asked by user237018 on July 29, 2021

I am trying to graph lines in Overleaf. Can someone help me make the lines y = 2x, y=1/2 x in the first quartile? Thanks.

One Answer

This is a done with pgfplots. Maybe it helps you getting started.

documentclass{article}
usepackage{pgfplots}

begin{document}
    
    begin{tikzpicture}
        
        begin{axis}[] 
            
            addplot[red]{2*x};
            addplot[blue]{x/2};
            
        end{axis}
    
        end{tikzpicture}

end{document}

enter image description here

or just with TIKZ:

documentclass{article}
usepackage{tikz}


begin{document}
    
    begin{tikzpicture}
        draw[->] (-3, 0) -- (3, 0) node[right] {$x$};
        draw[->] (0, -3) -- (0, 3) node[above] {$y$};
        draw[scale=0.5, domain=-3:3, smooth, variable=x, blue] plot ({x}, {2*x});
        draw[scale=0.5, domain=-6:6, smooth, variable=y, red]  plot ({y}, {y/2});
    end{tikzpicture}
    

end{document}

enter image description here

Answered by Roland on July 29, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP