TeX - LaTeX Asked by ekosman on June 23, 2021
I’m working on a latex project and I use pgfplots
for graphs. However, I encounter misalignment of them:
I notice that this problem completely disappears if I delete the axes data of the green and red curves:
What could cause this issue?
I did find the option after all: y tick label style={text width=2cm}
was the one I was looking for. Here is some example code (2cm is obviously way to large, but it proves the point)
In an actual plot make sure to additionally use: align=right
to make sure the numbers are aligned correctly at the axis.
documentclass{scrartcl}
usepackage[utf8]{inputenc}
usepackage{tikz,pgfplots}
begin{document}
begin{tikzpicture}
begin{axis}[y tick label style={text width=2cm%,align=right
}]
addplot coordinates {(1,1000) (3,2000)};
end{axis}
end{tikzpicture}
begin{tikzpicture}
begin{axis}[y tick label style={text width=2cm%,align=right
}]
addplot coordinates {(1,100) (3,200)};
end{axis}
end{tikzpicture}
end{document}
Note how both images are aligned correctly and have the same size.
Correct answer by Markus G. on June 23, 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