The second picture has a [x=0.25cm, y=0.25cm] which the first one does not.
- This is not equivalent to
scale=0.25, which you may be looking for.
- You tell TikZ explicitly in the second picture
xshift={sqrt(2)/2*\X*1cm}, yshift={sqrt(2)/2*\Y*1cm}, so it does not
care about the lengths of the unit vectors but just follows your
instructions.
- These lengths of the unit vectors do, however, have an
impact on the sizes of the gray rectangles, and the rectangle at the
end of the picture.
- TikZ treats dimensionless and dimensionful coordinates very differently, we usually do not care about this because we choose the standard unit vectors. If you choose different ones, you feel this. The perhaps clearest explanation of these issues
is in this nice
answer, which
discusses circles, not rectangles, but the qualitative argument is
the same.
BTW, it is not a good practice IMHO if you declare the loop
variables \x and \y in some code that makes use of the calc
syntax, which defines \x and \y on its own. Use e.g. \X and
\Y instead.
\documentclass{amsart}
\usepackage{tikz}
\usetikzlibrary{calc}
\begin{document}
\paragraph{Original picture}~\par\noindent
\begin{tikzpicture}
\foreach \Y in {0,2,...,8}
{\foreach \X in {0,2,...,8}
{\draw[fill=black!50, xshift={(1/4)*sqrt(2)/2*\X*1cm}, yshift={(1/4)*sqrt(2)/2*\Y*1cm}]
(0:{(1/4)*sqrt(2)/2}) -- (90:{(1/4)*sqrt(2)/2}) -- (180:{(1/4)*sqrt(2)/2}) -- (270:{(1/4)*sqrt(2)/2}) -- cycle;}
}
\draw ({-(1/4)*sqrt(2)/2},{-(1/4)*sqrt(2)/2}) rectangle ({(1/4)*9*sqrt(2)/2},{(1/4)*9*sqrt(2)/2});
\end{tikzpicture}
\bigskip
\hrule
\bigskip
\paragraph{Second picture} This changes the unit vectors/units but the \texttt{xshift}s and
\texttt{yshift}s are specified explicitly, i.e.\ with explicit lengths, and do
\emph{not} get multiplied by the unit vectors:\par\noindent
\begin{tikzpicture}[x=0.25cm, y=0.25cm]
\foreach \Y in {0,2,...,8}
{\foreach \X in {0,2,...,8}
{\draw[fill=black!50, xshift={sqrt(2)/2*\X*1cm}, yshift={sqrt(2)/2*\Y*1cm}]
let \n1={sqrt(2)/2} in
(0:\n1) -- (90:\n1) -- (180:\n1) -- (270:\n1) -- cycle;}
}
\draw let \n1={sqrt(2)/2} in (-\n1,-\n1) rectangle ({9*\n1},{9*\n1});
\end{tikzpicture}
\bigskip
\hrule
\bigskip
\paragraph{Alternative} This is what you may be looking for:\par\noindent
\begin{tikzpicture}[scale=0.25]
\foreach \Y in {0,2,...,8}
{\foreach \X in {0,2,...,8}
{\draw[fill=black!50, xshift={sqrt(2)/2*\X*1cm}, yshift={sqrt(2)/2*\Y*1cm}]
let \n1={sqrt(2)/2} in
(0:\n1) -- (90:\n1) -- (180:\n1) -- (270:\n1) -- cycle;}
}
\draw let \n1={sqrt(2)/2} in (-\n1,-\n1) rectangle ({9*\n1},{9*\n1});
\end{tikzpicture}
\end{document}

xshift={sqrt(2)/2*\x*1cm}andyshift={sqrt(2)/2*\y*1cm}ignore the optionsx=0.25cm, y=0.25cmin thetikzpictureenvironment? – A gal named Desire May 06 '19 at 21:27x=0.25cm, y=0.25cmandscale=0.25in thetikzpictureenvironment? – A gal named Desire May 06 '19 at 21:30x=0.25cm, y=0.25cmandscale=0.25are very different, at least in principle. So are the coordinates, say,(0,1)and(0,1cm). Apart from this answer maybe this answer may provide some additional insights. – May 06 '19 at 22:51