Scriptora AI Docs
Figures & Diagrams

TikZ Diagrams

Create diagrams natively in LaTeX using TikZ, pgfplots, and smartdiagram.

For diagrams that need to match your document's fonts and style exactly, use TikZ — LaTeX's built-in vector graphics system. The AI can generate TikZ code directly into your .tex file.

Available TikZ packages

PackageUse
tikzGeneral-purpose drawing
pgfplotsData plots (line, bar, scatter) with LaTeX fonts
tikz-cdCommutative diagrams (mathematics)
smartdiagramReady-made diagram styles (flow, cycle, priority)
circuitikzElectronic circuit diagrams
forestTree structures and parse trees
neuralnetworkNeural network architecture diagrams

Requesting a TikZ diagram

Ask the AI in chat:

Create a TikZ flowchart showing: Input → Preprocessing → Model → Output.
Use rounded boxes and arrows. The diagram should be 8cm wide.

The AI writes the TikZ code and inserts it into main.tex.

Example: pgfplots chart

\usepackage{pgfplots}
\pgfplotsset{compat=1.18}

\begin{tikzpicture}
\begin{axis}[
  xlabel={Epoch}, ylabel={Loss},
  legend pos=north east,
  width=8cm, height=5cm,
]
\addplot coordinates {(1,0.95)(20,0.5)(50,0.25)(100,0.12)};
\addlegendentry{Training}
\addplot coordinates {(1,0.98)(20,0.55)(50,0.32)(100,0.21)};
\addlegendentry{Validation}
\end{axis}
\end{tikzpicture}

When to use TikZ vs Python

ScenarioUse
Diagram needs to match document fontsTikZ
Data plot with many data pointsPython (matplotlib)
Architecture / flow diagramEither — TikZ for simple, Python/Graphviz for complex
Statistical chart (violin, box, heatmap)Python (seaborn)
Neural network diagramTikZ (neuralnetwork package)
Circuit diagramTikZ (circuitikz)

On this page