对于 TikZ 网格命令,我想知道当我指定一个步骤并且不从 (0,0) 开始时,为什么我在下面绘制的第二个网格中缺少最左边的线。
\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\draw[blue] (0,0) grid[step=5mm] (3,3);
\draw[red] (4,0) grid[step=5mm] (7,3);
\draw[green!50!black, xshift=8cm] grid[step=5mm] (3,3);
\end{tikzpicture}
\smallskip
\begin{tikzpicture}
\draw[blue] (0,0) grid (3,3);
\draw[red] (4,0) grid (7,3);
\draw[green!50!black, xshift=8cm] grid (3,3);
\end{tikzpicture}
\end{document}
答案1
编辑如下
\draw[red] (4-0.001,0-0.001) grid[step=5mm] (7,3);
平均能量损失
\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\draw[blue] (0,0) grid[step=5mm] (3,3);
\draw[red] (4-0.001,0-0.001) grid[step=5mm] (7,3);
\draw[green!50!black, xshift=8cm] grid[step=5mm] (3,3);
\end{tikzpicture}
\smallskip
\begin{tikzpicture}
\draw[blue] (0,0) grid (3,3);
\draw[red] (4,0) grid (7,3);
\draw[green!50!black, xshift=8cm] grid (3,3);
\end{tikzpicture}
\end{document}