![TikZ 网格线略有偏移](https://linux22.com/image/424842/TikZ%20%E7%BD%91%E6%A0%BC%E7%BA%BF%E7%95%A5%E6%9C%89%E5%81%8F%E7%A7%BB.png)
我知道这其实并不重要,但我不知道这是否是内部舍入错误,或者是否存在一些我不知道的偏移量,这让我很困扰!? a 的线条grid
略有偏移!通常只有在高缩放级别下才能在远角看到它。在这里我比较了 agrid
和 a rectangle
:
\documentclass[tikz, border=1cm]{standalone}
\usetikzlibrary{spy}
\begin{document}
\begin{tikzpicture}[spy using outlines={circle, magnification=35, size=1cm, connect spies}]
\draw[line cap=rect] (0,0) grid (1,1);
\draw[line width=0.01pt, red] (1cm+0.2pt,-0.1) -- (1cm+0.2pt,1.1) (1cm-0.2pt,-0.1) -- (1cm-0.2pt,1.1);
\spy[green] on (1,1) in node at (1.8,1.2);
\draw (0,-2) rectangle (1,-1);
\draw[line width=0.01pt, red] (1cm+0.2pt,-2.1) -- (1cm+0.2pt,-0.9) (1cm-0.2pt,-2.1) -- (1cm-0.2pt,-0.9);
\spy[blue] on (1,-1) in node at (1.8,-0.8);
\end{tikzpicture}
\end{document}