I am trying to create a a grid of deformed hexagons in the y direction. The following solution given by @Ignasi seems okay for the undeformed case
and after trying to modify the code, I am not able to get what I want, so I am thinking of the possibility of deforming the resulting tikz image.
Is there any command that I can use to achieve what I want?
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{patterns}
\def\hexagonsize{0.5cm}
\pgfdeclarepatternformonly
{hexagons}% name
{\pgfpointorigin}% lower left
{\pgfpoint{3\hexagonsize}{0.8660252\hexagonsize}}% upper right
{\pgfpoint{3\hexagonsize}{0.8660252\hexagonsize}}% tile size
{% shape description
\pgfsetlinewidth{0.4pt}
\pgftransformshift{\pgfpoint{0mm}{0.866025\hexagonsize}}
\pgfpathmoveto{\pgfpoint{0mm}{0mm}}
\pgfpathlineto{\pgfpoint{0.5\hexagonsize}{0mm}}
\pgfpathlineto{\pgfpoint{\hexagonsize}{-0.866025\hexagonsize}}
\pgfpathlineto{\pgfpoint{2\hexagonsize}{-0.866025\hexagonsize}}
\pgfpathlineto{\pgfpoint{2.5\hexagonsize}{0mm}}
\pgfpathlineto{\pgfpoint{3\hexagonsize+0.2mm}{0mm}}
\pgfpathmoveto{\pgfpoint{0.5\hexagonsize}{0mm}}
\pgfpathlineto{\pgfpoint{\hexagonsize}{0.866025\hexagonsize}}
\pgfpathlineto{\pgfpoint{2\hexagonsize}{0.866025\hexagonsize}}
\pgfpathlineto{\pgfpoint{2.5\hexagonsize}{0mm}}
\pgfusepath{stroke}
}
\begin{document}
\begin{tikzpicture}
\fill[pattern=hexagons] (0,0) rectangle (5,5);
\end{tikzpicture}
\end{document}
And what I want is to stretch the image in the vertical direction. For example, in terms of images, if this is a 100x100 image, I would like to convert it to a 100x200 image.
In regards to the code, the idea is to extend the length of the sides of the hexagon in the y direction, but I am not able to do it. I have tried to multiply the numbers by 2 or something like that, but I was not successful



tikzpictureoptionscale=<amount>. However, for better help you please provide a small but complete document with your image, that we see what you try so far. – Zarko Apr 09 '22 at 09:43