5

I have a main.tex in which I import plots as tikzpictures with includegraphics. A typical plot looks like this

\begin{tikzpicture}
  \def \dataFile {'plots/data/sample_data.dat'}

  \begin{axis}
    \addplot[] gnuplot [raw gnuplot] { plot \dataFile index 0 };
  \end{axis}

\end{tikzpicture}

Now, I want to make a beamer presentation using the same tikzpictures. The presentation.tex file is located in a different folder entirely. I've updated my graphicspath accordingly, but when I want to include a tikzpicture, it cannot find the data file sample_data.dat, because gnuplot is being invocated in the folder of presentation.tex.

I couldn't find a way of setting the input directory to the pgfplots raw gnuplot command. Short of specifying every data file location as a full path, is there a clever way to solve this?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.