# Drawing plane distribution in 3D

I would like to draw a plane distribution with TikZ.

Here is how it should look like:

I know how to draw a plane with the coordinate axis, but don't know how to draw planes depending on the base-point.

Any help is appreciated.

• Welcome! Please post what you can do in the form of a minimal working example i.e. code for a complete, small document showing what you've tried. What specific problem are you having? Right now this is another do-it-for-me. You may get lucky. Or not. You stand a better chance of getting useful help if you help us to help you by showing us where you are. – cfr Jul 31 '17 at 17:43
• This is the standard contact distribution in R^3. The plane at point (x0,y0,z0) has cartesian equation z = y0 * x. That is, this plane bundle is the kernel of the 1-form dz - y dx. See wikipedia, where this picture comes from. – marsupilam Jul 31 '17 at 18:11

Here's something to get you started. I'm not sure if I've accurately reproduced your figure---I rotated the small squares around the y-axis to recreate the figure. I've tried colouring the axes red, to make them standout from the planes a bit more.

\documentclass[tikz, border=1mm]{standalone}
\begin{document}

\def\h{0.38}

\begin{tikzpicture}[
point/.style = {inner sep=1pt, fill=gray},
y={(-10:1cm)},
x={(205:0.8cm)},
z={(90:0.8cm)},
scale=0.7,
axis/.style = {
red!75!black,
->
}
]
\foreach \x in {-5, ..., 5} {
\foreach \y [
evaluate=\y as \t using 65*\y/5,
evaluate=\t as \s using -sin(\t),
evaluate=\t as \c using  cos(\t),
] in {-5, ..., 5} {
\draw[fill=gray!30]
(\x +\c*\h, \y - \h, -\s*\h) --
(\x +\c*\h, \y + \h, -\s*\h) --
(\x -\c*\h, \y + \h,  \s*\h) --
(\x -\c*\h, \y - \h,  \s*\h) -- cycle;
}
}

\draw[axis] (-7, 0, 0) -- (7, 0, 0) node[below right] {$x$};
\draw[axis] ( 0,-8, 0) -- (0, 8, 0) node[above] {$y$};
\draw[axis] ( 0, 0,-4) -- (0, 0, 4) node[right] {$z$};
\end{tikzpicture}
\end{document}


Using pgfplots.

## The code

\documentclass[12pt,tikz,border=0pt]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.15}
\begin{document}
\begin{tikzpicture}
[
declare function={alpha(\x,\y) = \y*\x;}
]
\def\a{1.2}
\def\b{.5}
\def\delt{.08}
\begin{axis}
[
height=10cm,
samples = 2,
samples y = 2,
axis lines = center,
xmin=-\a, xmax=\a,
ymin=-\a, ymax=\a,
zmin = -\b, zmax = \b,
domain = -\delt:\delt, domain y = -\delt:\delt,
ticks=none,
]
\foreach \xx in {-1,-.8,...,1}
{
\foreach \yy in {-1,-.8,...,1}
{