Skip to main content
pgfplots lets you generate vector plots directly in LaTeX.

Basic Plot

pgfplots-basic.tex
\usepackage{pgfplots}
\pgfplotsset{compat=1.18}

\begin{tikzpicture}
  \begin{axis}[xlabel={$x$},ylabel={$f(x)$},grid=major]
    \addplot[blue,thick,domain=0:5,samples=100]{x^2};
  \end{axis}
\end{tikzpicture}

Plot from Data Table

pgfplots-table.tex
\begin{axis}[xlabel=Epoch,ylabel=Accuracy]
  \addplot table[row sep=\\]{
  1 0.61\\
  2 0.68\\
  3 0.74\\
  4 0.79\\
  };
\end{axis}