% This file is embedded in datatool-user.pdf version 3.4.4 2026-07-31
% Example 176 Positive and Negative Axes
% Label: "ex:plotxy"
% arara: pdflatex
% arara: pdfcrop
\documentclass[12pt]{article}
\pagestyle{empty}
\begin{filecontents}[noheader,overwrite]{xydata.csv}
X,Y
-3.5,-2.75
-3,3
-2.5,-1
-1,1.5
1,-4.2
2.6,1.8
3.2,-0.4
\end{filecontents}

\usepackage{dataplot}
\DTLsetup{store-datum}
\DTLread[
 name=xydata,
 format=csv,
 csv-content=no-parse
 , data-types=decimal
]{xydata.csv} 
\begin{document}
Beware of narrow tick gaps! 

\DTLplot{xydata}{
 x=X, y={Y},
 tick-dir=out,
 % consider switching to max-x-label and max-y-label instead in the following to reduce overlap:
 x-label={$x$}, y-label={$y$},
 % consider changing the tick label offset and font size to reduce clutter:
 % tick-label-style={font=\small}, tick-label-offset=0pt,
 style=lines, width=3in, height=3in
} 
\end{document}
