I've two \scaleboxs each of which placed in a scope environment as follows:
\documentclass[border=5cm]{standalone}
\usepackage{tikz}
\usetikzlibrary{positioning}
\usetikzlibrary{shapes}
\newcommand{\hexlattice}[1]{\begin{tikzpicture}[hexa/.style= {shape=regular polygon,regular polygon sides=6,minimum size=1cm, draw,inner sep=0,anchor=south,rotate=30}]
\foreach \j in {0,...,#1}{%
\foreach \i in {-1,...,#1}{%
\node[hexa] (h\i;\j) at ({(\i-\j/2)*sin(60)},{\j*0.75}) {};} }
\end{tikzpicture}}
\begin{document}
\begin{tikzpicture}[scale=1.1,every node/.style={minimum size=1cm},on grid]
\begin{scope}[yshift=-120]
\draw[black, dashed, thin, xshift=30mm, yshift=0.5mm,xslant=-.8] (1,4) rectangle (7,6);
\scalebox{0.8}[0.4]{\hexlattice{5}}
\end{scope}
\begin{scope}[yshift=0]
\draw[black, dashed, thin, xshift=30mm, xslant=-.8] (1,4) rectangle (7,6);
\scalebox{0.8}[0.4]{\hexlattice{5}}
\end{scope}
\end{tikzpicture}
\end{document}
However, the second \scalebox yields nothing after compilation as below:
Could you please let me know of what I'm doing wrong here?!



tikzpictures, which is not supported, and does not produce reliable results. – Feb 03 '19 at 16:25tikzpictures but you need to place the inner ones into a node of the outer one. @marmot – Martin Scharrer Feb 03 '19 at 16:36pics are for. You want the dashed rectangles be filled with a hexagonal lattice? When you slant, is that a honest-to-god slant or a 3d projection? – Feb 03 '19 at 16:40tikzpictureinside a\node. If you couldn't I would see that as a design flaw. Who does not recommend it? – Martin Scharrer Feb 03 '19 at 16:42