| 1 |
% This file is embedded in datatool-user.pdf version 3.4.3 2025-12-04 |
| 2 |
% Example 176 Positive and Negative Axes |
| 3 |
% Label: "ex:plotxy" |
| 4 |
% arara: pdflatex |
| 5 |
% arara: pdfcrop |
| 6 |
\documentclass[12pt]{article} |
| 7 |
\pagestyle{empty} |
| 8 |
\begin{filecontents}[noheader,overwrite]{xydata.csv} |
| 9 |
X,Y |
| 10 |
-3.5,-2.75 |
| 11 |
-3,3 |
| 12 |
-2.5,-1 |
| 13 |
-1,1.5 |
| 14 |
1,-4.2 |
| 15 |
2.6,1.8 |
| 16 |
3.2,-0.4 |
| 17 |
\end{filecontents} |
| 18 |
|
| 19 |
\usepackage{dataplot} |
| 20 |
\DTLsetup{store-datum} |
| 21 |
\DTLread[ |
| 22 |
name=xydata, |
| 23 |
format=csv, |
| 24 |
csv-content=no-parse |
| 25 |
, data-types=decimal |
| 26 |
]{xydata.csv} |
| 27 |
\begin{document} |
| 28 |
Beware of narrow tick gaps! |
| 29 |
|
| 30 |
\DTLplot{xydata}{ |
| 31 |
x=X, y={Y}, |
| 32 |
tick-dir=out, |
| 33 |
% consider switching to max-x-label and max-y-label instead in the following to reduce overlap: |
| 34 |
x-label={$x$}, y-label={$y$}, |
| 35 |
% consider changing the tick label offset and font size to reduce clutter: |
| 36 |
% tick-label-style={font=\small}, tick-label-offset=0pt, |
| 37 |
style=lines, width=3in, height=3in |
| 38 |
} |
| 39 |
\end{document} |