Scriptora AI Docs
Figures & Diagrams

Inserting Images

How to include figures, control size and placement, and use subfigures.

Basic figure

\begin{figure}[t]
  \centering
  \includegraphics[width=0.8\linewidth]{figures/my_plot.png}
  \caption{A caption describing the figure.}
  \label{fig:myplot}
\end{figure}

Placement specifiers

SpecifierMeaning
[t]Top of the page (recommended for papers)
[b]Bottom of the page
[h]Here (approximately where it appears in source)
[H]Exactly here (requires float package)
[!t]Force top, overriding LaTeX's spacing rules

Most conference templates prefer [t] or [htbp].

Controlling size

\includegraphics[width=0.8\linewidth]{...}   % 80% of text width
\includegraphics[width=5cm]{...}             % fixed width
\includegraphics[height=4cm]{...}            % fixed height
\includegraphics[scale=0.5]{...}             % 50% of original size

Two figures side by side

\begin{figure}[t]
  \centering
  \begin{subfigure}{0.48\linewidth}
    \includegraphics[width=\linewidth]{figures/fig_a.png}
    \caption{First result.}
    \label{fig:a}
  \end{subfigure}
  \hfill
  \begin{subfigure}{0.48\linewidth}
    \includegraphics[width=\linewidth]{figures/fig_b.png}
    \caption{Second result.}
    \label{fig:b}
  \end{subfigure}
  \caption{Comparison of results.}
  \label{fig:comparison}
\end{figure}

Requires \usepackage{subcaption} in preamble.

Referencing figures

As shown in Figure~\ref{fig:myplot}, the accuracy improves...

Always use ~ before \ref to prevent a line break between "Figure" and the number.

Supported formats

FormatNotes
.pngBest for screenshots, rasterized plots
.pdfBest for vector graphics (TikZ, matplotlib PDF output)
.epsLegacy vector format — convert to PDF when possible
.jpgPhotos — avoid for plots (compression artifacts)
.svgRequires svg package; convert to PDF for reliability

On this page