So I want to draw a picture like this.
However I can get no where close to it. I have tried following other posts and adapting them which has allowed be to set the axis up correctly but I just cannot get the cubes the same way. Other than putting the location of each cube in manually is there a way to generate all cubes in one go. I don't even need as many cubes as there are in the attatched image, I just want a similar image.
I was able to do this with squares in the 2 dim plane in the following way:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{shapes.geometric}
\begin{document}
\begin{tikzpicture}[square/.style={regular polygon,regular polygon sides=4}]
% Coordinate axes
\begin{scope}[
semithick,
->,
]
\draw (0, 0) -- (0, 9.5);
\draw (0, 0) -- (9.5, 0);
\end{scope}
\draw[node font=\small]
\foreach \y in {0, ..., 9} {
(0, \y) +(.25em, 0) -- ++(-.25em, 0)
node[left] {$\y$}
}
\foreach \x in {1, ..., 9} {
(\x,0) +(0, .25em) -- ++(0, -.25em)
node[below] {$\x$}
} ;
\foreach \x in {0, ..., 9} {
\foreach \y in {0, ..., 9} {
\node[draw,square,inner sep=5pt,fill] at (\x+.5,\y+.5) {};
}
}
\end{tikzpicture}
\end{document}
I would like to be able to do something similar, if possible.
Best Answer
Edit with closer output to the request, but still the angles needs adjustment (I will not do it)
Old Answer that just shows the basic code needed:
Here is a way: