Research Tools

CSV to PGFPlots — Scientific LaTeX Graph Generator

Turn CSV data into a PGFPlots figure for LaTeX: line, scatter, bar, grouped and horizontal bar charts, histograms and box plots, with error bars, log axes and a live preview. Download a .tex file that compiles as it is, or a ZIP with the data as a separate CSV.
Runs in your browserNothing is uploadedTested with PGFPlots 1.18

Runs in your browser

This tool processes your input on your device. Files you select are not uploaded to MuhammadLab.

Example loaded.

Data

Paste CSV, open a file or start from an example. The first row is used as column names.

Read 1.234,5 as 1234.5 (use semicolons between columns).

ColumnTypeNumbersMissingNot numbers
Epochnumeric2000
Training lossnumeric2000
Validation lossnumeric1910
Validation SDnumeric2000

20 rows. Empty cells and NA, N/A, NaN, null or - are treated as missing values.

Plot

  • Series 1

  • Series 2

Axes and style

LaTeX output

Write titles, labels and names as typed (for $\mu$, \textsuperscript and so on) instead of escaping %, _, & and $.

Preview

51015200.511.52Model trainingEpochLossTraining lossValidation loss

Browser preview drawn with D3. Fonts, tick positions and label spacing are chosen by TeX, so the compiled figure can differ slightly.

  • info: "Validation loss": 1 row with a missing value is left out (row 9).

LaTeX

Required packages

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

PGFPlots loads TikZ and xcolor. Tested with PGFPlots 1.18 in pdfLaTeX and LuaLaTeX.

The .tex file contains the data, so it compiles on its own. Nothing is saved in your browser.

How to use this tool

  1. 1Paste CSV data, open a CSV file or choose an example.
  2. 2Choose the plot type, the x column and one or more data columns, with optional error columns.
  3. 3Set labels, legend, log axes, grid, size and colours, and check the preview and data checks.
  4. 4Copy or download the .tex file, or the ZIP with the data as a separate CSV file.

Frequently asked questions

Yes. Every plot type and data option is compiled with PGFPlots 1.18 in pdfLaTeX (and LuaLaTeX for some cases) as part of the tool’s tests. A complete document uses the standalone class; a figure snippet lists the preamble lines it needs: \usepackage{pgfplots}, \pgfplotsset{compat=1.18} and, for box plots, \usepgfplotslibrary{statistics}.

Inline coordinates put each point in the .tex file and are easiest to share. An inline table keeps the data as one readable block. An external CSV keeps the data in a separate file that the figure reads, which suits large data sets and data that changes; the ZIP download keeps the data/ folder next to the .tex file so the paths work.

Empty cells and NA, N/A, NaN, null or - are treated as missing. For lines you choose whether a missing value is left out (the line continues) or breaks the line. Text in a numeric column is never turned into a number; it is left out and listed by row so you can fix it.

They cannot be shown on a logarithmic axis, so they are rejected and reported with their row numbers instead of being silently dropped or altered. Switch the axis to linear to include them. Axis limits on a log axis must also be greater than zero.

Box plots use quartiles by linear interpolation (the default in R, NumPy and Excel’s QUARTILE.INC), whiskers at the most extreme values within 1.5 times the interquartile range, and the remaining points drawn as outliers. Histograms use rounded bin edges shared by every data set, so overlaid histograms can be compared; each value is counted once.

The preview is drawn in the browser with D3 from the same settings. TeX chooses its own fonts, tick positions and label spacing, so the compiled figure can differ in small details. The data, axes and styles are the same.

Yes. Turn on “LaTeX in labels” to write labels as typed, for example $\mu$m or 10\textsuperscript{3}. With it off, characters such as %, _, & and $ are escaped so they print as written.

No. Parsing, the preview and the LaTeX are all produced in your browser; large files are read in a background worker on your device. Nothing is uploaded or saved.