I am plotting three surf plots in a groupplot environment with pgfplots. For the third groupplot, I have enabled the colorbar. I would like the colorbar to represent all three plots, so equal z values should have equal colors. I can set zmax on the group plot, but this will only limit the axes in a 3D plot, the colormap appears to be applied from the minimal to the maximal value, regardless of the value of zmin and zmax. Is there a way to make the range of a colormap correspond to zmin and zmax? (Clamping will not be a problem in this case, because zmax is chosen such that nothing is clamped. The problem is that currently, one of my plots reaches only about half of zmax, but at this point the colormap is still at maximum intensity.)

\begin{groupplot}[group style = {group size = 3 by 1, horizontal sep = 1.5cm},
                  zmax = 50, view = {0}{90}]
\nextgroupplot[xlabel = $x_2$, ylabel = $x_3$]
\addplot3[surf, shader = interp] table {data-x2x3.dat};
\nextgroupplot[xlabel = $x_3$, ylabel = $x_1$]
\addplot3[surf, shader = interp] table {data-x3x1.dat};
\nextgroupplot[xlabel = $x_1$, ylabel = $x_2$, colorbar]
\addplot3[surf, shader = interp] table {data-x1x2.dat};
  • 1
    You can set point meta max=..., point meta min=....
    – Jake
    Apr 23, 2015 at 9:08
  • That is exactly what I was looking for! If you turn your comment into an answer I’ll accept it.
    – Ruud
    Apr 23, 2015 at 9:46

1 Answer 1


As Jake said in his comment, the properties to set are point meta min and point meta max on the axis (or groupplot in this case).

Not the answer you're looking for? Browse other questions tagged .