Graphics & Figures

Figures, Graphics & Diagrams

Detailed guide on floating figures, graphicx inclusion options (width, scale, angle, clip), subcaption side-by-side figures, and TikZ vector diagrams.

🖼️ 6 Essential Figure & Subfigure Styles

Choose between standard centered floats, side-by-side subfigures with (a) & (b) labels, framed border boxes, text-wrapped inline illustrations, or side-by-side figure+table pairs.

Advanced Figures & Subfigures

Advanced Figures & Subfigures

Comprehensive syntax, arguments, options, and copyable snippets for advanced figures & subfigures.

Environment Mandatory { }

\begin{subfigure}{width}...\end{subfigure}

Places one panel of a multi-part figure (subcaption package)

Example Code
\begin{subfigure}{0.45\textwidth}
\includegraphics{a.png}
\caption{Sample A}
\end{subfigure}
Command Mandatory { }

\subcaption{text}

Caption for an individual subfigure panel (subcaption package)

Example Code
\subcaption{Left panel}
Environment Mandatory { }

\begin{wrapfigure}{pos}{width}...\end{wrapfigure}

Wraps body text around a figure (wrapfig package)

💡 Deep Dive Explanation & Options

Text-Wrapped Inline Graphic: pos specifies alignment (r: right, l: left). width sets reserved horizontal box width.

Example Code
\begin{wrapfigure}{r}{0.4\textwidth}
\includegraphics[width=\linewidth]{fig.png}
\end{wrapfigure}
Environment Mandatory { }

\begin{longtable}{cols}...\end{longtable}

Multi-page table that can break across pages (longtable package)

Example Code
\begin{longtable}{cc}
A & B \\
\hline
\endhead
1 & 2 \\
\end{longtable}
Command

\endhead

Marks the header row(s) to repeat on every page of a longtable

Example Code
\endhead
Command

\endfirsthead

Marks the header shown only on the first page of a longtable

Example Code
\endfirsthead
Command

\endfoot

Marks the footer row(s) to repeat on every page of a longtable

Example Code
\endfoot
Command

\sidewaystable

Rotates a table 90 degrees on its own page (rotating package)

Example Code
\begin{sidewaystable}
\caption{Wide data}
\end{sidewaystable}
Colors & Image Inclusion

Colors & Image Inclusion

Comprehensive syntax, arguments, options, and copyable snippets for colors & image inclusion.

Command Mandatory { }

\textcolor{color}{text}

Colors text (xcolor)

Example Code
\textcolor{red}{Warning!}
Command Mandatory { }

\colorbox{color}{text}

Colored background box (xcolor)

Example Code
\colorbox{yellow}{Highlighted}
Command Mandatory { }

\fcolorbox{border}{bg}{text}

Framed and colored box (xcolor)

Example Code
\fcolorbox{black}{yellow}{Boxed text}
Command Mandatory { }

\pagecolor{color}

Sets page background color (xcolor)

Example Code
\pagecolor{lightgray}
Command Mandatory { }

\definecolor{name}{model}{spec}

Defines a custom color (xcolor)

Example Code
\definecolor{myblue}{RGB}{0,102,204}
Command Mandatory { }

\rotatebox{angle}{text}

Rotates content (graphicx)

Example Code
\rotatebox{45}{Tilted text}
Command Mandatory { }

\scalebox{factor}{text}

Scales content (graphicx)

Example Code
\scalebox{2}{Big text}
Command Mandatory { }

\resizebox{width}{height}{text}

Resizes content to given dimensions (graphicx)

Example Code
\resizebox{3cm}{1cm}{Stretched text}
TikZ Vector Graphics

TikZ Vector Graphics

Comprehensive syntax, arguments, options, and copyable snippets for tikz vector graphics.

Environment Mandatory { }

\begin{tikzpicture}...\end{tikzpicture}

Container for a TikZ vector drawing (tikz package)

Example Code
\begin{tikzpicture}
\draw (0,0) circle (1cm);
\end{tikzpicture}
Command

\draw

Draws a path, line, or shape in TikZ

Example Code
\draw (0,0) -- (2,2);
Command

\node

Places a labeled node/point in TikZ

Example Code
\node at (1,1) {$P$};
Command

\coordinate

Defines a named coordinate point in TikZ

Example Code
\coordinate (A) at (0,0);
Command

\fill

Draws and fills a closed shape in TikZ

Example Code
\fill[blue] (0,0) rectangle (1,1);
Command

\filldraw

Fills and outlines a shape in one command (TikZ)

Example Code
\filldraw[fill=yellow, draw=black] (0,0) circle (0.5);
Environment Mandatory { }

\begin{axis}...\end{axis}

Plots data/functions on labeled axes (pgfplots package)

Example Code
\begin{axis}
\addplot {x^2};
\end{axis}
Command

\addplot

Adds a data series or function plot inside an axis environment (pgfplots)

Example Code
\addplot table {data.dat};
Command Mandatory { }

\usetikzlibrary{name}

Loads a TikZ library for extra shapes/features

Example Code
\usetikzlibrary{arrows.meta}