I'd like to draw a memory layout diagram in Tikz that looks a bit like the following:
Note that the original was an SVG file, and conversion to PNG causes the weird [Not supported by viewer] errors, not sure what that's about.
Anyway, how can I recreate that diagram in Tikz, but without the numbered stages, and with the sections starting at the very left?
I tried to modify this answer to near it to the posted image, but I don't know enough Tikz to get it quite there.
Best Answer
Something like this:
This is done using tikz but to hide the technicalities I have defined a macro
\MemoryLayout
that accepts a coma separated list of x-coordinates/colours/labels so that the image above was produced by:Use a label of
\relax
when you do not want a label.All that this macro does is loop over the input data to draw the picture using standard tikz commands. Here is the full code:
To remove the numbers just comment out the two
\draw[thick]...;
commands.