pgfplots 对齐问题

pgfplots 对齐问题

我正在尝试创建一个对齐的组图,但得到的结果并不令人满意。我开始yshift在下一个组图中进行操作,甚至在单个图中进行操作,但我无法使整体结果看起来对齐。理想情况下,我希望每个方形域(由于视角而看起来像菱形)都对齐。这是我目前所拥有的:

\documentclass[border={10pt 10pt 10pt 10pt}]{standalone}

\usepackage{tikz}
\usepackage{pgfplots}
\usetikzlibrary{pgfplots.groupplots, backgrounds}

\begin{document}
\begin{tikzpicture}  

\begin{groupplot}[
    group style={
        group name=my plots,
        group size=5 by 7,
        xlabels at=edge bottom,
        xticklabels at=edge bottom,
        horizontal sep=5pt,
        vertical sep=0pt,
    },
%       3d box=complete,
        width=3.5cm,
        colormap/viridis,
        axis lines*=left,
        xmin=-1,xmax=1,
        ymin=-1,ymax=1,
        view={-45}{45},
%       view={-80}{15},
        axis line style={draw=none},
        tick style={draw=none},
        ticks=none,
        ]

%\nextgroupplot[group/empty plot]
%\nextgroupplot[group/empty plot]
%\nextgroupplot[group/empty plot]
%\nextgroupplot[group/empty plot]
%\nextgroupplot[group/empty plot]

% first row
\nextgroupplot[]
%\addplot3[patch,patch type=triangle,faceted color=gray,fill opacity=0.1, draw opacity=0] coordinates {(-1,-1,0) (1,-1,0) (-1,1,0) (1,-1,0) (1,1,0) (-1,1,0)};
\addplot3 [surf, color=gray] coordinates { (-1,-1,0) (1,-1,0) (1,1,0) (-1,1,0) (-1,-1,0) };
\addplot3[surf, domain=-1:1,y domain=-1:1] {0.25*(1-x)*(1-y)};


\nextgroupplot[]
\addplot3 [surf, color=gray] coordinates { (-1,-1,0) (1,-1,0) (1,1,0) (-1,1,0) (-1,-1,0) };
\addplot3[surf, domain=-1:1,y domain=-1:1] {-(sqrt(1.5)*(-1 + x^2)*(-1 + y))/4.};
%\addplot3[patch,patch type=triangle,faceted color=gray,fill opacity=0.1, draw opacity=0] coordinates {(-1,-1,0) (1,-1,0) (-1,1,0) (1,-1,0) (1,1,0) (-1,1,0)};

\nextgroupplot[]
%\addplot3[patch,patch type=triangle,faceted color=gray,fill opacity=0.1, draw opacity=0] coordinates {(-1,-1,0) (1,-1,0) (-1,1,0) (1,-1,0) (1,1,0) (-1,1,0)};
\addplot3 [surf, color=gray] coordinates { (-1,-1,0) (1,-1,0) (1,1,0) (-1,1,0) (-1,-1,0) };
\addplot3[surf, domain=-1:1,y domain=-1:1] {-(sqrt(2.5)*x*(-1 + x^2)*(-1 + y))/4.};

\nextgroupplot[]
%\addplot3[patch,patch type=triangle,faceted color=gray,fill opacity=0.1, draw opacity=0] coordinates {(-1,-1,0) (1,-1,0) (-1,1,0) (1,-1,0) (1,1,0) (-1,1,0)};
\addplot3 [surf, color=gray] coordinates { (-1,-1,0) (1,-1,0) (1,1,0) (-1,1,0) (-1,-1,0) };
\addplot3[surf, domain=-1:1,y domain=-1:1] {-(sqrt(3.5)*(1 - 6*x^2 + 5*x^4)*(-1 + y))/16.};

\nextgroupplot[]
%\addplot3[patch,patch type=triangle,faceted color=gray,fill opacity=0.1, draw opacity=0] coordinates {(-1,-1,0) (1,-1,0) (-1,1,0) (1,-1,0) (1,1,0) (-1,1,0)};
\addplot3 [surf, color=gray] coordinates { (-1,-1,0) (1,-1,0) (1,1,0) (-1,1,0) (-1,-1,0) };
\addplot3[surf, domain=-1:1,y domain=-1:1] {(-3*x*(3 - 10*x^2 + 7*x^4)*(-1 + y))/(16.*sqrt(2))};


% second row

\nextgroupplot[]
%\addplot3[patch,patch type=triangle,faceted color=gray,fill opacity=0.1, draw opacity=0] coordinates {(-1,-1,0) (1,-1,0) (-1,1,0) (1,-1,0) (1,1,0) (-1,1,0)};
\addplot3 [surf, color=gray] coordinates { (-1,-1,0) (1,-1,0) (1,1,0) (-1,1,0) (-1,-1,0) };
\addplot3[surf, domain=-1:1,y domain=-1:1] {0.25*(1+x)*(1-y)};

\nextgroupplot[]
\addplot3 [surf, color=gray] coordinates { (-1,-1,0) (1,-1,0) (1,1,0) (-1,1,0) (-1,-1,0) };
\addplot3[surf, domain=-1:1,y domain=-1:1] {(sqrt(1.5)*(1 + x)*(-1 + y^2))/4.};
%\addplot3[patch,patch type=triangle,faceted color=gray,fill opacity=0.1, draw opacity=0] coordinates {(-1,-1,0) (1,-1,0) (-1,1,0) (1,-1,0) (1,1,0) (-1,1,0)};

\nextgroupplot[]
%\addplot3[patch,patch type=triangle,faceted color=gray,fill opacity=0.1, draw opacity=0] coordinates {(-1,-1,0) (1,-1,0) (-1,1,0) (1,-1,0) (1,1,0) (-1,1,0)};
\addplot3 [surf, color=gray] coordinates { (-1,-1,0) (1,-1,0) (1,1,0) (-1,1,0) (-1,-1,0) };
\addplot3[surf, domain=-1:1,y domain=-1:1] {(sqrt(2.5)*(1 + x)*y*(-1 + y^2))/4.};

\nextgroupplot[]
%\addplot3[patch,patch type=triangle,faceted color=gray,fill opacity=0.1, draw opacity=0] coordinates {(-1,-1,0) (1,-1,0) (-1,1,0) (1,-1,0) (1,1,0) (-1,1,0)};
\addplot3 [surf, color=gray] coordinates { (-1,-1,0) (1,-1,0) (1,1,0) (-1,1,0) (-1,-1,0) };
\addplot3[surf, domain=-1:1,y domain=-1:1] {(sqrt(3.5)*(1 + x)*(1 - 6*y^2 + 5*y^4))/16.};

\nextgroupplot[]
%\addplot3[patch,patch type=triangle,faceted color=gray,fill opacity=0.1, draw opacity=0] coordinates {(-1,-1,0) (1,-1,0) (-1,1,0) (1,-1,0) (1,1,0) (-1,1,0)};
\addplot3 [surf, color=gray] coordinates { (-1,-1,0) (1,-1,0) (1,1,0) (-1,1,0) (-1,-1,0) };
\addplot3[surf, domain=-1:1,y domain=-1:1] {(3*(1 + x)*y*(3 - 10*y^2 + 7*y^4))/(16.*sqrt(2))};


% third row


\nextgroupplot[]
%\addplot3[patch,patch type=triangle,faceted color=gray,fill opacity=0.1, draw opacity=0] coordinates {(-1,-1,0) (1,-1,0) (-1,1,0) (1,-1,0) (1,1,0) (-1,1,0)};
\addplot3 [surf, color=gray] coordinates { (-1,-1,0) (1,-1,0) (1,1,0) (-1,1,0) (-1,-1,0) };
\addplot3[surf, domain=-1:1,y domain=-1:1] {0.25*(1+x)*(1+y)};

\nextgroupplot[]
\addplot3 [surf, color=gray] coordinates { (-1,-1,0) (1,-1,0) (1,1,0) (-1,1,0) (-1,-1,0) };
\addplot3[surf, domain=-1:1,y domain=-1:1] {(sqrt(1.5)*(-1 + x^2)*(1 + y))/4.};
%\addplot3[patch,patch type=triangle,faceted color=gray,fill opacity=0.1, draw opacity=0] coordinates {(-1,-1,0) (1,-1,0) (-1,1,0) (1,-1,0) (1,1,0) (-1,1,0)};

\nextgroupplot[]
%\addplot3[patch,patch type=triangle,faceted color=gray,fill opacity=0.1, draw opacity=0] coordinates {(-1,-1,0) (1,-1,0) (-1,1,0) (1,-1,0) (1,1,0) (-1,1,0)};
\addplot3 [surf, color=gray] coordinates { (-1,-1,0) (1,-1,0) (1,1,0) (-1,1,0) (-1,-1,0) };
\addplot3[surf, domain=-1:1,y domain=-1:1] {(sqrt(2.5)*x*(-1 + x^2)*(1 + y))/4.};

\nextgroupplot[]
%\addplot3[patch,patch type=triangle,faceted color=gray,fill opacity=0.1, draw opacity=0] coordinates {(-1,-1,0) (1,-1,0) (-1,1,0) (1,-1,0) (1,1,0) (-1,1,0)};
\addplot3 [surf, color=gray] coordinates { (-1,-1,0) (1,-1,0) (1,1,0) (-1,1,0) (-1,-1,0) };
\addplot3[surf, domain=-1:1,y domain=-1:1] {(sqrt(3.5)*(1 - 6*x^2 + 5*x^4)*(1 + y))/16.};

\nextgroupplot[]
%\addplot3[patch,patch type=triangle,faceted color=gray,fill opacity=0.1, draw opacity=0] coordinates {(-1,-1,0) (1,-1,0) (-1,1,0) (1,-1,0) (1,1,0) (-1,1,0)};
\addplot3 [surf, color=gray] coordinates { (-1,-1,0) (1,-1,0) (1,1,0) (-1,1,0) (-1,-1,0) };
\addplot3[surf, domain=-1:1,y domain=-1:1] {(3*x*(3 - 10*x^2 + 7*x^4)*(1 + y))/(16.*sqrt(2))};

% fourth row

\nextgroupplot[]
%\addplot3[patch,patch type=triangle,faceted color=gray,fill opacity=0.1, draw opacity=0] coordinates {(-1,-1,0) (1,-1,0) (-1,1,0) (1,-1,0) (1,1,0) (-1,1,0)};
\addplot3 [surf, color=gray] coordinates { (-1,-1,0) (1,-1,0) (1,1,0) (-1,1,0) (-1,-1,0) };
\addplot3[surf, domain=-1:1,y domain=-1:1] {0.25*(1-x)*(1+y)};


\nextgroupplot[]
\addplot3 [surf, color=gray] coordinates { (-1,-1,0) (1,-1,0) (1,1,0) (-1,1,0) (-1,-1,0) };
\addplot3[surf, domain=-1:1,y domain=-1:1] {-(sqrt(1.5)*(-1 + x)*(-1 + y^2))/4.};
%\addplot3[patch,patch type=triangle,faceted color=gray,fill opacity=0.1, draw opacity=0] coordinates {(-1,-1,0) (1,-1,0) (-1,1,0) (1,-1,0) (1,1,0) (-1,1,0)};


\nextgroupplot[]
%\addplot3[patch,patch type=triangle,faceted color=gray,fill opacity=0.1, draw opacity=0] coordinates {(-1,-1,0) (1,-1,0) (-1,1,0) (1,-1,0) (1,1,0) (-1,1,0)};
\addplot3 [surf, color=gray] coordinates { (-1,-1,0) (1,-1,0) (1,1,0) (-1,1,0) (-1,-1,0) };
\addplot3[surf, domain=-1:1,y domain=-1:1] {-(sqrt(2.5)*(-1 + x)*y*(-1 + y^2))/4.};


\nextgroupplot[]
%\addplot3[patch,patch type=triangle,faceted color=gray,fill opacity=0.1, draw opacity=0] coordinates {(-1,-1,0) (1,-1,0) (-1,1,0) (1,-1,0) (1,1,0) (-1,1,0)};
\addplot3 [surf, color=gray] coordinates { (-1,-1,0) (1,-1,0) (1,1,0) (-1,1,0) (-1,-1,0) };
\addplot3[surf, domain=-1:1,y domain=-1:1] {-(sqrt(3.5)*(-1 + x)*(1 - 6*y^2 + 5*y^4))/16.};


\nextgroupplot[]
%\addplot3[patch,patch type=triangle,faceted color=gray,fill opacity=0.1, draw opacity=0] coordinates {(-1,-1,0) (1,-1,0) (-1,1,0) (1,-1,0) (1,1,0) (-1,1,0)};
\addplot3 [surf, color=gray] coordinates { (-1,-1,0) (1,-1,0) (1,1,0) (-1,1,0) (-1,-1,0) };
\addplot3[surf, domain=-1:1,y domain=-1:1] {(-3*(-1 + x)*y*(3 - 10*y^2 + 7*y^4))/(16.*sqrt(2))};


% fifth row

\nextgroupplot[group/empty plot]
\nextgroupplot[group/empty plot]
\nextgroupplot[group/empty plot]

\nextgroupplot[]
%\addplot3[patch,patch type=triangle,faceted color=gray,fill opacity=0.1, draw opacity=0] coordinates {(-1,-1,0) (1,-1,0) (-1,1,0) (1,-1,0) (1,1,0) (-1,1,0)};
\addplot3 [surf, color=gray] coordinates { (-1,-1,0) (1,-1,0) (1,1,0) (-1,1,0) (-1,-1,0) };
\addplot3[surf, domain=-1:1,y domain=-1:1] {(3*(-1 + x^2)*(-1 + y^2))/8.};

\nextgroupplot[]
%\addplot3[patch,patch type=triangle,faceted color=gray,fill opacity=0.1, draw opacity=0] coordinates {(-1,-1,0) (1,-1,0) (-1,1,0) (1,-1,0) (1,1,0) (-1,1,0)};
\addplot3 [surf, color=gray] coordinates { (-1,-1,0) (1,-1,0) (1,1,0) (-1,1,0) (-1,-1,0) };
\addplot3[surf, domain=-1:1,y domain=-1:1] {(sqrt(15)*x*(-1 + x^2)*(-1 + y^2))/8.};

\nextgroupplot[group/empty plot]
\nextgroupplot[group/empty plot]
\nextgroupplot[group/empty plot]
\nextgroupplot[group/empty plot]


\nextgroupplot[]
%\addplot3[patch,patch type=triangle,faceted color=gray,fill opacity=0.1, draw opacity=0] coordinates {(-1,-1,0) (1,-1,0) (-1,1,0) (1,-1,0) (1,1,0) (-1,1,0)};
\addplot3 [surf, color=gray] coordinates { (-1,-1,0) (1,-1,0) (1,1,0) (-1,1,0) (-1,-1,0) };
\addplot3[surf, domain=-1:1,y domain=-1:1] {(sqrt(15)*(-1 + x^2)*y*(-1 + y^2))/8.};

\end{groupplot}

    % draw the background rectangles
    \begin{scope}[
        on background layer,
        rounded corners=10pt,
    ]
        \pgfmathsetlengthmacro{\Shift}{0pt}
        \fill [black!5]
            ([shift={(-\Shift,\Shift)}] my plots c1r1.west)
                rectangle
            ([shift={(\Shift,-\Shift)}] my plots c1r4.south east)
        ;
        \fill [black!10]
            ([shift={(-\Shift,\Shift)}] my plots c2r1.west)
                rectangle
            ([shift={(\Shift,-\Shift)}] my plots c5r4.south east)
        ;
        \fill [black!15]
            ([shift={(-\Shift,\Shift)}] my plots c4r5.west)
                rectangle
            ([shift={(\Shift,-\Shift)}] my plots c5r6.south east)
        ;
    \end{scope}

\end{tikzpicture}
\end{document}

答案1

一个快速的解决方案是将所有设置groupplots为具有相同的zminzmax

\nextgroupplot[zmin=-1, zmax=1]

群图

\documentclass[border={10pt 10pt 10pt 10pt}]{standalone}

\usepackage{tikz}
\usepackage{pgfplots}
\usetikzlibrary{pgfplots.groupplots, backgrounds}

\begin{document}
    \begin{tikzpicture}  

    \begin{groupplot}[
    group style={
        group name=my plots,
        group size=5 by 7,
        xlabels at=edge bottom,
        xticklabels at=edge bottom,
        horizontal sep=5pt,
        vertical sep=0pt,
    },
    %       3d box=complete,
    width=3.5cm,
    colormap/viridis,
    axis lines*=left,
    xmin=-1,xmax=1,
    ymin=-1,ymax=1,
    view={-45}{45},
    %       view={-80}{15},
    axis line style={draw=none},
    tick style={draw=none},
    ticks=none,
    ]

    %\nextgroupplot[group/empty plot]
    %\nextgroupplot[group/empty plot]
    %\nextgroupplot[group/empty plot]
    %\nextgroupplot[group/empty plot]
    %\nextgroupplot[group/empty plot]

    % first row
    \nextgroupplot[zmin=-1, zmax=1]
    %\addplot3[patch,patch type=triangle,faceted color=gray,fill opacity=0.1, draw opacity=0] coordinates {(-1,-1,0) (1,-1,0) (-1,1,0) (1,-1,0) (1,1,0) (-1,1,0)};
    \addplot3 [surf, color=gray] coordinates { (-1,-1,0) (1,-1,0) (1,1,0) (-1,1,0) (-1,-1,0) };
    \addplot3[surf, domain=-1:1,y domain=-1:1] {0.25*(1-x)*(1-y)};


    \nextgroupplot[zmin=-1, zmax=1]
    \addplot3 [surf, color=gray] coordinates { (-1,-1,0) (1,-1,0) (1,1,0) (-1,1,0) (-1,-1,0) };
    \addplot3[surf, domain=-1:1,y domain=-1:1] {-(sqrt(1.5)*(-1 + x^2)*(-1 + y))/4.};
    %\addplot3[patch,patch type=triangle,faceted color=gray,fill opacity=0.1, draw opacity=0] coordinates {(-1,-1,0) (1,-1,0) (-1,1,0) (1,-1,0) (1,1,0) (-1,1,0)};

    \nextgroupplot[zmin=-1, zmax=1]
    %\addplot3[patch,patch type=triangle,faceted color=gray,fill opacity=0.1, draw opacity=0] coordinates {(-1,-1,0) (1,-1,0) (-1,1,0) (1,-1,0) (1,1,0) (-1,1,0)};
    \addplot3 [surf, color=gray] coordinates { (-1,-1,0) (1,-1,0) (1,1,0) (-1,1,0) (-1,-1,0) };
    \addplot3[surf, domain=-1:1,y domain=-1:1] {-(sqrt(2.5)*x*(-1 + x^2)*(-1 + y))/4.};

    \nextgroupplot[zmin=-1, zmax=1]
    %\addplot3[patch,patch type=triangle,faceted color=gray,fill opacity=0.1, draw opacity=0] coordinates {(-1,-1,0) (1,-1,0) (-1,1,0) (1,-1,0) (1,1,0) (-1,1,0)};
    \addplot3 [surf, color=gray] coordinates { (-1,-1,0) (1,-1,0) (1,1,0) (-1,1,0) (-1,-1,0) };
    \addplot3[surf, domain=-1:1,y domain=-1:1] {-(sqrt(3.5)*(1 - 6*x^2 + 5*x^4)*(-1 + y))/16.};

    \nextgroupplot[zmin=-1, zmax=1]
    %\addplot3[patch,patch type=triangle,faceted color=gray,fill opacity=0.1, draw opacity=0] coordinates {(-1,-1,0) (1,-1,0) (-1,1,0) (1,-1,0) (1,1,0) (-1,1,0)};
    \addplot3 [surf, color=gray] coordinates { (-1,-1,0) (1,-1,0) (1,1,0) (-1,1,0) (-1,-1,0) };
    \addplot3[surf, domain=-1:1,y domain=-1:1] {(-3*x*(3 - 10*x^2 + 7*x^4)*(-1 + y))/(16.*sqrt(2))};


    % second row

    \nextgroupplot[zmin=-1, zmax=1]
    %\addplot3[patch,patch type=triangle,faceted color=gray,fill opacity=0.1, draw opacity=0] coordinates {(-1,-1,0) (1,-1,0) (-1,1,0) (1,-1,0) (1,1,0) (-1,1,0)};
    \addplot3 [surf, color=gray] coordinates { (-1,-1,0) (1,-1,0) (1,1,0) (-1,1,0) (-1,-1,0) };
    \addplot3[surf, domain=-1:1,y domain=-1:1] {0.25*(1+x)*(1-y)};

    \nextgroupplot[zmin=-1, zmax=1]
    \addplot3 [surf, color=gray] coordinates { (-1,-1,0) (1,-1,0) (1,1,0) (-1,1,0) (-1,-1,0) };
    \addplot3[surf, domain=-1:1,y domain=-1:1] {(sqrt(1.5)*(1 + x)*(-1 + y^2))/4.};
    %\addplot3[patch,patch type=triangle,faceted color=gray,fill opacity=0.1, draw opacity=0] coordinates {(-1,-1,0) (1,-1,0) (-1,1,0) (1,-1,0) (1,1,0) (-1,1,0)};

    \nextgroupplot[zmin=-1, zmax=1]
    %\addplot3[patch,patch type=triangle,faceted color=gray,fill opacity=0.1, draw opacity=0] coordinates {(-1,-1,0) (1,-1,0) (-1,1,0) (1,-1,0) (1,1,0) (-1,1,0)};
    \addplot3 [surf, color=gray] coordinates { (-1,-1,0) (1,-1,0) (1,1,0) (-1,1,0) (-1,-1,0) };
    \addplot3[surf, domain=-1:1,y domain=-1:1] {(sqrt(2.5)*(1 + x)*y*(-1 + y^2))/4.};

    \nextgroupplot[zmin=-1, zmax=1]
    %\addplot3[patch,patch type=triangle,faceted color=gray,fill opacity=0.1, draw opacity=0] coordinates {(-1,-1,0) (1,-1,0) (-1,1,0) (1,-1,0) (1,1,0) (-1,1,0)};
    \addplot3 [surf, color=gray] coordinates { (-1,-1,0) (1,-1,0) (1,1,0) (-1,1,0) (-1,-1,0) };
    \addplot3[surf, domain=-1:1,y domain=-1:1] {(sqrt(3.5)*(1 + x)*(1 - 6*y^2 + 5*y^4))/16.};

    \nextgroupplot[zmin=-1, zmax=1]
    %\addplot3[patch,patch type=triangle,faceted color=gray,fill opacity=0.1, draw opacity=0] coordinates {(-1,-1,0) (1,-1,0) (-1,1,0) (1,-1,0) (1,1,0) (-1,1,0)};
    \addplot3 [surf, color=gray] coordinates { (-1,-1,0) (1,-1,0) (1,1,0) (-1,1,0) (-1,-1,0) };
    \addplot3[surf, domain=-1:1,y domain=-1:1] {(3*(1 + x)*y*(3 - 10*y^2 + 7*y^4))/(16.*sqrt(2))};


    % third row


    \nextgroupplot[zmin=-1, zmax=1]
    %\addplot3[patch,patch type=triangle,faceted color=gray,fill opacity=0.1, draw opacity=0] coordinates {(-1,-1,0) (1,-1,0) (-1,1,0) (1,-1,0) (1,1,0) (-1,1,0)};
    \addplot3 [surf, color=gray] coordinates { (-1,-1,0) (1,-1,0) (1,1,0) (-1,1,0) (-1,-1,0) };
    \addplot3[surf, domain=-1:1,y domain=-1:1] {0.25*(1+x)*(1+y)};

    \nextgroupplot[zmin=-1, zmax=1]
    \addplot3 [surf, color=gray] coordinates { (-1,-1,0) (1,-1,0) (1,1,0) (-1,1,0) (-1,-1,0) };
    \addplot3[surf, domain=-1:1,y domain=-1:1] {(sqrt(1.5)*(-1 + x^2)*(1 + y))/4.};
    %\addplot3[patch,patch type=triangle,faceted color=gray,fill opacity=0.1, draw opacity=0] coordinates {(-1,-1,0) (1,-1,0) (-1,1,0) (1,-1,0) (1,1,0) (-1,1,0)};

    \nextgroupplot[zmin=-1, zmax=1]
    %\addplot3[patch,patch type=triangle,faceted color=gray,fill opacity=0.1, draw opacity=0] coordinates {(-1,-1,0) (1,-1,0) (-1,1,0) (1,-1,0) (1,1,0) (-1,1,0)};
    \addplot3 [surf, color=gray] coordinates { (-1,-1,0) (1,-1,0) (1,1,0) (-1,1,0) (-1,-1,0) };
    \addplot3[surf, domain=-1:1,y domain=-1:1] {(sqrt(2.5)*x*(-1 + x^2)*(1 + y))/4.};

    \nextgroupplot[zmin=-1, zmax=1]
    %\addplot3[patch,patch type=triangle,faceted color=gray,fill opacity=0.1, draw opacity=0] coordinates {(-1,-1,0) (1,-1,0) (-1,1,0) (1,-1,0) (1,1,0) (-1,1,0)};
    \addplot3 [surf, color=gray] coordinates { (-1,-1,0) (1,-1,0) (1,1,0) (-1,1,0) (-1,-1,0) };
    \addplot3[surf, domain=-1:1,y domain=-1:1] {(sqrt(3.5)*(1 - 6*x^2 + 5*x^4)*(1 + y))/16.};

    \nextgroupplot[zmin=-1, zmax=1]
    %\addplot3[patch,patch type=triangle,faceted color=gray,fill opacity=0.1, draw opacity=0] coordinates {(-1,-1,0) (1,-1,0) (-1,1,0) (1,-1,0) (1,1,0) (-1,1,0)};
    \addplot3 [surf, color=gray] coordinates { (-1,-1,0) (1,-1,0) (1,1,0) (-1,1,0) (-1,-1,0) };
    \addplot3[surf, domain=-1:1,y domain=-1:1] {(3*x*(3 - 10*x^2 + 7*x^4)*(1 + y))/(16.*sqrt(2))};

    % fourth row

    \nextgroupplot[zmin=-1, zmax=1]
    %\addplot3[patch,patch type=triangle,faceted color=gray,fill opacity=0.1, draw opacity=0] coordinates {(-1,-1,0) (1,-1,0) (-1,1,0) (1,-1,0) (1,1,0) (-1,1,0)};
    \addplot3 [surf, color=gray] coordinates { (-1,-1,0) (1,-1,0) (1,1,0) (-1,1,0) (-1,-1,0) };
    \addplot3[surf, domain=-1:1,y domain=-1:1] {0.25*(1-x)*(1+y)};


    \nextgroupplot[zmin=-1, zmax=1]
    \addplot3 [surf, color=gray] coordinates { (-1,-1,0) (1,-1,0) (1,1,0) (-1,1,0) (-1,-1,0) };
    \addplot3[surf, domain=-1:1,y domain=-1:1] {-(sqrt(1.5)*(-1 + x)*(-1 + y^2))/4.};
    %\addplot3[patch,patch type=triangle,faceted color=gray,fill opacity=0.1, draw opacity=0] coordinates {(-1,-1,0) (1,-1,0) (-1,1,0) (1,-1,0) (1,1,0) (-1,1,0)};


    \nextgroupplot[zmin=-1, zmax=1]
    %\addplot3[patch,patch type=triangle,faceted color=gray,fill opacity=0.1, draw opacity=0] coordinates {(-1,-1,0) (1,-1,0) (-1,1,0) (1,-1,0) (1,1,0) (-1,1,0)};
    \addplot3 [surf, color=gray] coordinates { (-1,-1,0) (1,-1,0) (1,1,0) (-1,1,0) (-1,-1,0) };
    \addplot3[surf, domain=-1:1,y domain=-1:1] {-(sqrt(2.5)*(-1 + x)*y*(-1 + y^2))/4.};


    \nextgroupplot[zmin=-1, zmax=1]
    %\addplot3[patch,patch type=triangle,faceted color=gray,fill opacity=0.1, draw opacity=0] coordinates {(-1,-1,0) (1,-1,0) (-1,1,0) (1,-1,0) (1,1,0) (-1,1,0)};
    \addplot3 [surf, color=gray] coordinates { (-1,-1,0) (1,-1,0) (1,1,0) (-1,1,0) (-1,-1,0) };
    \addplot3[surf, domain=-1:1,y domain=-1:1] {-(sqrt(3.5)*(-1 + x)*(1 - 6*y^2 + 5*y^4))/16.};


    \nextgroupplot[zmin=-1, zmax=1]
    %\addplot3[patch,patch type=triangle,faceted color=gray,fill opacity=0.1, draw opacity=0] coordinates {(-1,-1,0) (1,-1,0) (-1,1,0) (1,-1,0) (1,1,0) (-1,1,0)};
    \addplot3 [surf, color=gray] coordinates { (-1,-1,0) (1,-1,0) (1,1,0) (-1,1,0) (-1,-1,0) };
    \addplot3[surf, domain=-1:1,y domain=-1:1] {(-3*(-1 + x)*y*(3 - 10*y^2 + 7*y^4))/(16.*sqrt(2))};


    % fifth row

    \nextgroupplot[group/empty plot]
    \nextgroupplot[group/empty plot]
    \nextgroupplot[group/empty plot]

    \nextgroupplot[zmin=-1, zmax=1]
    %\addplot3[patch,patch type=triangle,faceted color=gray,fill opacity=0.1, draw opacity=0] coordinates {(-1,-1,0) (1,-1,0) (-1,1,0) (1,-1,0) (1,1,0) (-1,1,0)};
    \addplot3 [surf, color=gray] coordinates { (-1,-1,0) (1,-1,0) (1,1,0) (-1,1,0) (-1,-1,0) };
    \addplot3[surf, domain=-1:1,y domain=-1:1] {(3*(-1 + x^2)*(-1 + y^2))/8.};

    \nextgroupplot[zmin=-1, zmax=1]
    %\addplot3[patch,patch type=triangle,faceted color=gray,fill opacity=0.1, draw opacity=0] coordinates {(-1,-1,0) (1,-1,0) (-1,1,0) (1,-1,0) (1,1,0) (-1,1,0)};
    \addplot3 [surf, color=gray] coordinates { (-1,-1,0) (1,-1,0) (1,1,0) (-1,1,0) (-1,-1,0) };
    \addplot3[surf, domain=-1:1,y domain=-1:1] {(sqrt(15)*x*(-1 + x^2)*(-1 + y^2))/8.};

    \nextgroupplot[group/empty plot]
    \nextgroupplot[group/empty plot]
    \nextgroupplot[group/empty plot]
    \nextgroupplot[group/empty plot]


    \nextgroupplot[zmin=-1, zmax=1]
    %\addplot3[patch,patch type=triangle,faceted color=gray,fill opacity=0.1, draw opacity=0] coordinates {(-1,-1,0) (1,-1,0) (-1,1,0) (1,-1,0) (1,1,0) (-1,1,0)};
    \addplot3 [surf, color=gray] coordinates { (-1,-1,0) (1,-1,0) (1,1,0) (-1,1,0) (-1,-1,0) };
    \addplot3[surf, domain=-1:1,y domain=-1:1] {(sqrt(15)*(-1 + x^2)*y*(-1 + y^2))/8.};

    \end{groupplot}

    % draw the background rectangles
    \begin{scope}[
    on background layer,
    rounded corners=10pt,
    ]
    \pgfmathsetlengthmacro{\Shift}{0pt}
    \fill [black!5]
    ([shift={(-\Shift,\Shift)}] my plots c1r1.west)
    rectangle
    ([shift={(\Shift,-\Shift)}] my plots c1r4.south east)
    ;
    \fill [black!10]
    ([shift={(-\Shift,\Shift)}] my plots c2r1.west)
    rectangle
    ([shift={(\Shift,-\Shift)}] my plots c5r4.south east)
    ;
    \fill [black!15]
    ([shift={(-\Shift,\Shift)}] my plots c4r5.west)
    rectangle
    ([shift={(\Shift,-\Shift)}] my plots c5r6.south east)
    ;
    \end{scope}

    \end{tikzpicture}
\end{document}

相关内容