TeX - LaTeX Asked by evencoil on January 6, 2021
This creates a simple plot with axes and the lines y = x and y = – x.
documentclass{standalone}
usepackage{tikz}
usepackage{pgfplots}
pgfplotsset{compat=1.13}
begin{document}
begin{tikzpicture}
begin{axis}[
axis lines=middle,
ticks=none,
]
addplot[thick, black] {x};
addplot[thick, black] {-1 * x};
end{axis}
end{tikzpicture}
end{document}
Produces this (the border is an artifact of my screenshot, but its not important):
If you hold up a 90 degree angle (say a piece of paper) to the intersection of the x and y axes you can see that they are nicely perpendicular.
However, if you do the same for the lines y = x and y = -x, you see that they are not perpendicular.
What gives?
The axis is not square, so they shouldn't be perpendicular.
Either set the width
and height
to the same value in the axis
options, or try adding axis equal
, which will make the unit vectors in x and y have the same length.
Correct answer by Torbjørn T. on January 6, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP