# Help in Creating a Legend for a Block Diagram in Tikz

I have a block diagram finished, but I need help in creating a legend for it.

I'm trying to create a legend that looks like that picture below. I want to be able to 1st create this type of graphic and also be able to x & y shift the entire graphic in my block diagram.

I'm new to TeX, but I manged to learn a lot in the past few days. Yet, I looked for a way to implement this, but no luck.

• Welcome to TeX.SE! If you share the code for your block diagram with us, I am pretty sure somebody will add a legend. – user121799 Nov 9 '18 at 19:33

There are likely many ways of doing something like that. Here's a quick hack. As this is for an existing diagram, you probably want to use styles for the different legend entries and corresponding arrows etc.

\documentclass[border=5mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{matrix, fit}
\begin{document}
\begin{tikzpicture}
\matrix [draw,
matrix of nodes,
column sep=4mm
]
(m) at (1,1) {
Legend 1 & Legend 2 \\
\draw [blue, ->] (-.25,0) -- (0.25,0) node[minimum height=5pt]{}; &
\draw [red, ->] (-.25,0) -- (0.25,0); \\
};

\node [left=-\pgflinewidth] (leg) at (m.west) {Legend};

\node [draw, inner sep=-0.5\pgflinewidth,fit=(leg)(m.north west)(m.south west)] {};

\end{tikzpicture}
\end{document}