# Using pgfplots and gnuplot and compiling with output-directory

I would like to use the pgfplots package along with gnuplot. However, I cannot get this to work if I compile using the -output-directory option. For example, if I have the following MWE:

\documentclass{article}

\usepackage{pgfplots}
\pgfplotsset{compat=1.8}

\begin{document}

\begin{tikzpicture}
\begin{axis}

If this is saved as test.tex and I compile with lualatex -shell-escape test.tex, it works fine. However, if I try to change the output directory, such a compiling with lualatex -shell-escape -output-directory=.. test.tex, then pgfplots cannot find the file test.pgf-plot.table which contains the gnuplot output. (The output directory .. was just to make this example as simple as possible.)
Is there a way to patch the command that reads gnuplot output to search for the file in the output directory instead of the current working directory?
Just my view ignore it: I usually avoid -output-directory when using gnuplottex,pstool -shell-escape applications due to foldernames,paths,synctex, etc... –  texenthusiast Apr 18 '13 at 4:01