The Tikz command \draw plot file{data/filename.dat} draws a line through the coordinates stored in filename.dat, which is contained in the subfolder data. Is there a Tikz equivalent to \graphicspath{{./data/}} so that I don't have to write data/ in front of every plot command?
This post shows how to it with the pgfplots package, but I'm wondering if there is a Tikz native way for the same feature. I don't really want to load the entire pgfplots package just to avoid typing data/.
Here is an MWE:
\begin{filecontents*}{data/somedata.dat}
1 2
3 4
5 6
\end{filecontents*}
\documentclass{standalone}
\usepackage{tikz, graphicx}
\graphicspath{{./data/}}
\begin{document}
\begin{tikzpicture}
\draw plot file{somedata.dat};
\end{tikzpicture}
\end{document}
prefix=data/? – Qrrbrbirlbel May 30 '23 at 23:49\tikzset{every plot/.style={prefix=data/}}doesn't seem to work. – S. Olafsson May 31 '23 at 04:11