I had created an tikz image using matlab2tikz, as seen below:

enter image description here

I would like to reduce the size of the individual spheres while keeping the dimensions of the overall image constant, essentially inserting some white space between each sphere. My code is too large to display directly, so I shall provide a link to the tikz file:


The code looks intimidatingly long but is essentially a series of axis environments with coordinates for the individual spherical harmonics.

  • You could just use use the first two rows as an MWE. Anyway, if you can add more space between the spheres, you can use \resizebox{\textwidth}{!} (graphicx package) over the whole thing. – John Kormylo Sep 26 '15 at 16:53
  • 1
    Still wondering about this? You can try expanding the axis limits a bit, by saying something like [/pgfplots/every axis/.append style={enlargelimits=0.2}]. This will add some whitespace around the sphere in each axis, hence making them smaller. Then you may want to increase \figureheight and \figurewidth a bit to make larger again. – Torbjørn T. Oct 9 '15 at 20:50

I added whitespace between the image by adding xshift and yshift to certain axis environments, depending on where I needed the space. This was quite difficult as many of environments are anchored to other environments.The image: enter image description here

A link to my code: https://www.dropbox.com/s/5mutzlu1tmrf2hg/SH1.tikz?dl=0

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.