I am using subimport to include .tex chunks from different folders. Everything except my tikz figures seems to work fine. Here is a minimum working example:

organization:

main.tex
> Folder1 > chapter1.tex
> data > turn_0.3.csv


my main.tex file:

\documentclass[conference]{IEEEtran}
\usepackage{pgfplots}
\usepackage{tikz}
\pgfplotsset{plot coordinates/math parser=false}
\newlength\figurewidth

\usepackage{import}
\begin{document}

\subimport{folder1/}{chapter1}

\end{document}


chapter1.tex:

\begin{figure}
\centering
\begin{tikzpicture}
\begin{axis}[
width=0.8\columnwidth,
height=0.5\columnwidth,
scale only axis,
xmin=0,
xmax=120,
grid=major,
inner axis line style={->},
xlabel={Time [s]},
axis x line*=bottom,
axis y line*=left,
no markers,
smooth,
]
\addplot[solid] table [x index = 0, y index =1, col sep=semicolon, green] {data/turn_0_3.csv};
\end{axis}
\end{tikzpicture}
\caption{Network usage in bytes per second for a single robot performing a 360  [$^\circ$] in-place rotation.}
\label{rot_bandwidth}
\end{figure}


the .csv is a 3 column seperated by ';'.

I get the following error:

 Package pgfplots Error: Could not read table file 'data/turn_0_3.csv'. In case you intended to provide inline data: maybe TeX screwed up your end-of-lines? Try row sep=crcr' and terminate your lines with \\' (refer to the pgfplotstable manual for details).


I can fix this be adding

\makeatletter
\def\relativepath{\import@path}
\makeatother


in the main.tex and appending \relativepath to the

\addplot[solid] table [x index = 0, y index =1, col sep=semicolon, green] {\relativepath data/turn_0_3.csv};


But I would like to have a solution that does not require modifying chapter1.tex file.