I am building a groupplot using extikzpicture to externalize the graphics so that I can later just include them when I submit the paper for publication. I would like to reduce the size of the final groupplot. I could probably work this out on my own, but I'm working with severely compromised internet access at the moment, so it's difficult to research anything....even in posting this question, I can't get the full editor to load...hope I can make this look decent with markdown....

The code below (which is not an MWE) is the offending bit

            group style={group size=2 by 2,
                                     group name = fig5_plots,
                         xlabels at=edge bottom,
                         ylabels at=edge left
                        xlabel = {\footnotesize $\rho$},
                        ylabel = {\footnotesize $\gamma$},
                                    colorbar horizontal,
                                    colorbar to name=ContourColorbar,
                                    y tick label style={
                                        /pgf/number format/.cd,
                                        fixed zerofill,
                                    x tick label style={
                                        /pgf/number format/.cd,
                                        fixed zerofill,
                        \nextgroupplot[title={\scriptsize +Resources}, z buffer=sort]
                                        \addplot3[surf, shader=interp,mesh,black] file {Reactive_ComeAndGo_Surface.txt};
                                        \addplot3[surf, shader=interp,colormap/blackwhite, opacity=0.8] file {PlusReactive_DecreasingAlpha_Surface.txt};
                                    \nextgroupplot[title={\scriptsize ++Resources}, z buffer=sort]
                                        \addplot3[surf, mesh,black] file {Reactive_ComeAndGo_Surface.txt};
                                        \addplot3[surf, shader=interp,colormap/blackwhite, opacity=0.8] file {PlusPlusReactive_DecreasingAlpha_Surface.txt};
                                     %\nextgroupplot[title={\scriptsize +Resources Delta},view={0}{90},]
                                         \addplot3[surf, shader=interp] file {Plus_Reactive_Delta_Surface.txt};
                                     %\nextgroupplot[title={\scriptsize ++Resources Delta},view={0}{90},]
                                            \addplot3[surf, shader=interp] file {PlusPlus_Reactive_Delta_Surface.txt};
    \node (fig5_Legend) at ($(fig5_plots c1r2.center)!0.5!(fig5_plots c2r2.center)-(0,4.5cm)$){\ref{ContourColorbar}};
\caption{Reactive $\alpha$ Starting at Upper Bound}

You'll note the lines


in the groupstyle...they're the problem. If I remove those two lines, it compiles fine and produces an image, just one that is larger than I want.

enter image description here

Include those lines, and I get an error because there is no external image. When I look through the log file for that specific image, I find

Package pgfkeys Error: I do not know the key '/pgfplots/group/height', to whi ch you passed '10cm', and I am going to ignore it. Perhaps you misspelled it.

With my crappy internet access, I can't really search for anything. I have the pgfplot manual, which shows using the height and width keys in the groupstyle for a tikzpicture groupplot, so I assumed it would be the same for an extikzpicture, but evidently not.

  • where does the extikzpicture come from? – percusse Jul 16 '15 at 12:43
  • @percusse In the preamble \usepackage{pgfplots} \usepgfplotslibrary{external} – jerH Jul 16 '15 at 23:33


I misread the documentation. The height and width keys do not go in the group style.

On page 391 of the pgfplots manual I had seen this line

\begin{groupplot}[group style={group size=2 by 2},height=3cm,width=3cm]

And somehow my brain saw height and width inside the closing }, not outside. Move those keys out of the group style and you're golden.

I need to sleep more :)


I am trying to use something similar to your solution, and I realized that using extikzpicture has some limitations compare to the standard tikzpicture.

For instance, say I define a macro for my figure height in the preamble \newcommand{\fheight}{5cm}; if I now want to use it as the height of my groupplots in a standard tikzpicture, I can simply write height=\fheight as an option of the grouplot environment. However, if I do the same within the extikzpicture, I get the error

! Undefined control sequence. \pgfplots@height ->\fheight

No idea of the reason why.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.