← browse the library
Binary matrix preview
icon

Binary matrix

A grid of binary digits in curly braces, for raw data / encoded tensors / bit matrices.

idmatrix
typeicon
domainml
requirestikz, decorations.pathreplacing
licenseCC0-1.0
authorOpenTikZ contributors

matrixbinarybitsdataencodingtensor

SVG
matrix.tex
\documentclass[border=4pt]{standalone}

% --- packages (mirror these in matrix.meta.json "requires") ---
\usepackage{tikz}
\usetikzlibrary{decorations.pathreplacing}

% --- palette (canonical source: reference/color-palettes/color-palettes.md; light variant) ---
\definecolor{otblue}{HTML}{0072B2}
\definecolor{otorange}{HTML}{E69F00}
\definecolor{otteal}{HTML}{009E73}
\definecolor{otpurple}{HTML}{CC79A7}
\definecolor{otgray}{HTML}{5A5A5A}

\begin{document}
\begin{tikzpicture}
  % enclosing curly braces (neutral structure color)
  \draw[otgray, line width=1pt, decorate, decoration={brace, amplitude=8pt}]
    (-0.3,-0.05) -- (-0.3,1.75);
  \draw[otgray, line width=1pt, decorate, decoration={brace, amplitude=8pt, mirror}]
    (1.4,-0.05) -- (1.4,1.75);
  % binary matrix of bits (data-coloured)
  \begin{scope}[every node/.style={font=\ttfamily\large\bfseries, text=otblue}]
    % row 1: 1 1 0
    \node at (0.2,1.45) {1}; \node at (0.55,1.45) {1}; \node at (0.9,1.45) {0};
    % row 2: 0 0 0
    \node at (0.2,0.85) {0}; \node at (0.55,0.85) {0}; \node at (0.9,0.85) {0};
    % row 3: 1 0 1
    \node at (0.2,0.25) {1}; \node at (0.55,0.25) {0}; \node at (0.9,0.25) {1};
  \end{scope}
\end{tikzpicture}
\end{document}

Use it

The file compiles on its own (\documentclass{standalone}). Drop it into your project and \input it, or copy the tikzpicture into your figure. Colours come from the shared palette defined in the preamble — edit those named colours, not raw hex.

Graphic content is CC0 1.0 (public domain) — reuse freely, no attribution required.