\documentclass[tikz]{standalone}
\usepackage{pgfplots}
\usepackage{tikz-3dplot}
\usepackage[svgnames]{xcolor}
\usepgfplotslibrary{colorbrewer}

\def\datapath{../res/}

\begin{document}

\tdplotsetmaincoords{50}{25}

\def\onlyfront#1{
    \ifnum#1=2\else\ifnum#1=4\else\ifnum#1=6\else
    \def\pgfmathresult{}
    \fi\fi\fi}

\def\onlyback#1{
    \ifnum#1=1\else\ifnum#1=3\else\ifnum#1=5\else
    \def\pgfmathresult{}
    \fi\fi\fi}

\pgfplotsset{
    % forget plot = no legend
    cube/.style = {thick, gray!50!black,forget plot},
    onlyfront/.code = \pgfplotsset{x filter/.code={\onlyfront{\thisrow{face}}}},
    onlyback/.code = \pgfplotsset{x filter/.code={\onlyback{\thisrow{face}}}},
    data/.style = {mark=*, blue, only marks},
    backdata/.style = {mark=*, blue!30!white, only marks, onlyback, forget plot},
    iter1/.style = {mark=x, red},
    iter2/.style = {mark=star, BlueViolet},
    iter3/.style = {mark=asterisk, purple},
    backiter1/.style = {mark=x, red!30!white, onlyback, forget plot},
    backiter2/.style = {mark=star, BlueViolet!30!white, onlyback, forget plot},
    backiter3/.style = {mark=asterisk, purple!30!white, onlyback, forget plot},
    origin/.style = {mark=o, green, only marks, thick},
    surfstyle/.style = {very nearly opaque, forget plot},
    legend style = {
        inner sep = 0pt,
        outer xsep = 5pt,
        outer ysep = 0pt,
        legend cell align = left,
        align = left,
        draw = none,
        fill = none,
        font = \small
    },
    illustr3d/.style = {
        axis equal,
        width=5cm,
        height=5cm,
        scale only axis,
        enlargelimits=false,
        colormap access=map,
        colormap/Paired,
        colorbar,
        point meta rel=axis wide,
        shader = interp,
        xlabel = {$x$},
        ylabel = {$y$},
        zlabel = {$z$},
        ticks = none,
        axis line style = {draw=none},
        %axis x line = none,
        %axis y line = none,
        %axis z line = none,
        legend columns = 3,
        legend style = {
            at = {(0.5, 1.1)},
            anchor = north,
            column sep = 1ex,
        },
        mark size=1.5pt,
    }
}

\begin{tikzpicture}
    \begin{axis}[illustr3d]
        \addplot3[cube] coordinates {(0, 0, 0) (0, 1, 0) (0, 1, 1) };
        \addplot3[cube] coordinates {(0, 1, 0) (1, 1, 0) };
        \addplot3[backdata] table[x=x,y=y,z=z] {\datapath/data.csv};
        \addplot3[backiter1] table[x=x,y=y,z=z] {\datapath/x1_log.csv};
        \addplot3[backiter2] table[x=x,y=y,z=z] {\datapath/x2_log.csv};
        \addplot3[backiter3] table[x=x,y=y,z=z] {\datapath/x3_log.csv};

        \addplot3[
            surf,
            mesh/ordering=x varies,
            mesh/cols=32,
            mesh/rows=32,
            surfstyle,
        ] table [
            x = u,
            z = v,
            y expr = 0.0,
            point meta = \thisrow{value},
         ] {\datapath/F4.csv};
        \addplot3[
            surf,
            mesh/ordering=y varies,
            mesh/cols=32,
            mesh/rows=32,
            surfstyle,
        ] table [
            x expr = 1.0,
            y = u,
            z = v,
            point meta = \thisrow{value},
         ] {\datapath/F2.csv};
        \addplot3[
            surf,
            mesh/ordering=x varies,
            mesh/cols=32,
            mesh/rows=32,
            surfstyle,
        ] table [
            x = u,
            y = v,
            z expr = 1.0,
            point meta = \thisrow{value},
        ] {\datapath/F6.csv};
    
        % Edges
        \addplot3[cube] coordinates {(0, 0, 0) (1, 0, 0) (1, 0, 1) (0, 0, 1) (0, 0, 0)};
        \addplot3[cube] coordinates {(0, 0, 1) (0, 1, 1) (1, 1, 1) (1, 0, 1)};
        \addplot3[cube] coordinates {(1, 0, 0) (1, 1, 0) (1, 1, 1)};

        \addplot3[data,onlyfront] table[x=x,y=y,z=z] {\datapath/data.csv};
        \addlegendentry{Data}

        \addplot3[origin,onlyfront] table[x=x,y=y,z=z] {\datapath/origin.csv};
        \addlegendentry{Origin}

        \addplot3[iter1,onlyfront] table[x=x,y=y,z=z] {\datapath/x1_log.csv};
        \addlegendentry{Iterates 1}
        \addplot3[iter2,onlyfront] table[x=x,y=y,z=z] {\datapath/x2_log.csv};
        \addlegendentry{Iterates 2}
        \addplot3[iter3,onlyfront] table[x=x,y=y,z=z] {\datapath/x3_log.csv};
        \addlegendentry{Iterates 3}
    \end{axis}
\end{tikzpicture}

\end{document}