1
\documentclass[border= 5mm]{standalone}
\usepackage{filecontents,pgfplots}
\begin{filecontents}{data.txt}
x y z
2 1 5
3 2 6
2 4 7
4 4 4
5 5 5
6 7 8
9 10 11
\end{filecontents}

\begin{document}
\begin{tikzpicture}
\begin{axis}
    \addplot3 [patch, patch table={triangles.txt}
] shell {echo "data=dlmread('data.txt');
tri=delaunay(data(:,1), data(:,2));
dlmwrite('triangles.txt',tri-1,' ');
disp(data)" | octave --silent};
\end{axis}
\end{tikzpicture}
\end{document}

I am trying to use octave with pgfplot to plot something similar to what is asked here (the above code is similar to that given in an answer there). The problem is that I am getting the error:

Package pgfplots Error: Could not read table file 'triangles.txt' in 'search the pgfplotstable manual for details). disp(data)" | octave --silent};

Note that I installed Octave on my PC (W7) and I added it to the PATH using the command (in cmd): set PATH%PATH%;C:\Octave\Octave-4.2.0\bin. Also note that I cannot find a file called 'triangles' in the folder where my tex file is.

Any idea what is the problem?

closed as unclear what you're asking by Torbjørn T., CarLaTeX, Troy, user36296, TeXnician Jul 4 '17 at 16:18

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • Are you sure that Octave is added to the PATH? Because there was a similar question (tex.stackexchange.com/q/351556) where OP used the same cmd line command to add the program in question to the PATH, which obviously didn't work ... – Stefan Pinnow Mar 12 '17 at 20:34
  • Your code works perfectly fine here, and generates triangles.txt, so I would guess it's a path issue. – Torbjørn T. Jun 21 '17 at 18:31