tikz网格缺少最左边的线

tikz网格缺少最左边的线

对于 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}

相关内容