% This file is embedded in datatool-user.pdf version 3.4.3 2025-12-04
% Example 156 Scatter Plot with Custom Legend Labels (One Database, Two Sets of Data)
% Label: "ex:growthscatter4col-legend"
% arara: pdflatex
% arara: pdfcrop
\documentclass[12pt]{article}
\pagestyle{empty}
\usepackage{scontents}% to write test file with TABs preserved
\begin{scontents}[write-out={growth.tsv},overwrite]
Experiment 1		Experiment 2	
Time	Log Count	Time	Log Count
0	2.9	0	3.31
15	3.14	10	3.45
30	3.26	25	3.61
45	4.01	40	3.76
60	4.2	55	3.89
\end{scontents}

\usepackage{dataplot}
\DTLsetup{store-datum,default-name=growthdata}
\DTLread[
 format=tsv,csv-skip-lines=1,
 keys={Exp1Time,Exp1Count,Exp2Time,Exp2Count},
 csv-content=no-parse,
 data-types=decimal
]{growth} 
\begin{document}
 \DTLplot{growthdata}{
 x={Exp1Time,Exp2Time},
 y={Exp1Count,Exp2Count},
 x-label={Time ($t$)},y-label={Log Count},
 legend, legend-labels={Experiment 1,Experiment 2},
 width=2.5in, height=2.5in
} 
\end{document}
