Skip to content

Instantly share code, notes, and snippets.

@dfbarrero
Created March 23, 2017 09:49
Show Gist options
  • Select an option

  • Save dfbarrero/0b198bc7e57dd99b88eef0a0cc564f11 to your computer and use it in GitHub Desktop.

Select an option

Save dfbarrero/0b198bc7e57dd99b88eef0a0cc564f11 to your computer and use it in GitHub Desktop.
Matrix figure with LaTeX/Tikz
\begin{tikzpicture}[draw, minimum width=1cm, minimum height=0.5cm]
\node[draw] (in) at (-1,2) {};
\node[draw] (out) at (1,2) {};
\matrix (queue)[matrix of nodes, nodes={draw, nodes={draw}}, nodes in empty cells]
{
\\ \\ \\ \\
};
\draw[-latex] (0.25,1) .. controls (0.25,1.5) and (1,1.5) .. (out.south);
\draw[-latex] (in.south) .. controls (-1, 1.5) and (-0.25,1.5) .. (-0.25,1);
\end{tikzpicture}
@rpmendez

rpmendez commented Apr 7, 2020

Copy link
Copy Markdown

Hi! I got the helpful code I needed from your https://atc1.aut.uah.es/~david/notes/2017/03/datastructures-in-tikz/ post, but I caught an error you might like to know about--it looks like you saved your "stack" example over your "matrix" example and then linked both to .../matrix.tex .

As I mentioned, I'm covered (thank you for posting!), I'm just letting you know.
Cheers,
Robert

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment