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.
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}
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}
Answered by Roland on July 29, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP