I get an incorrect vertical offset in 3D plots when using GraphicsRow in Mathematica 9 (Linux - Ubuntu 12.04). When displayed by itself, the plot is fine. Here's an example:

f[x_, y_] := Exp[-x^2 - y^2]

Showing the plot by itself works as expected:

a = Plot3D[f[x, y], {x, -2, 2}, {y, -2, 2}]

Gaussian shown once

However an incorrect vertical offset appears when showing the plot multiple times with GraphicsRow:

GraphicsRow[{a, a}, ImageSize -> Large]

Gaussian shown twice

Does anybody also have this problem? Any idea how to fix this?

  • $\begingroup$ Doesn't it work GraphicsRow[{a, a}, ImageSize -> Large] either ? $\endgroup$ – Artes Dec 20 '12 at 14:22
  • $\begingroup$ Nasser: Your plots look OK... On my side the surfaces (not the axes) are offset by about -.5 (sorry if I can't post an image - I'm new and do not have enough points yet). $\endgroup$ – jerome Dec 20 '12 at 14:38
  • $\begingroup$ Artes: the problem is the same when I use GraphicsRow[{a, a}, ImageSize -> Large]. As Nasser suggests, this might be an issue with the Linux version. $\endgroup$ – jerome Dec 20 '12 at 14:41
  • $\begingroup$ Jerome, you should post your update as an answer instead, since it solves the problem. I know that as a new user you might not be able to post a self-answer until after about 8 hrs of asking, but please consider posting it after the time has passed :) $\endgroup$ – rm -rf Dec 20 '12 at 15:11
  • 2
    $\begingroup$ @Jerome Can you please post a screenshot of the problem in the question (to make it very clear what this is about) and post your finding as an answer? This might help other Linux users who run into this problem. Please also try starting Mathematica with the option mathematica -mesa and see if that fixed the problem. $\endgroup$ – Szabolcs Dec 20 '12 at 20:31

I found the cause of this: it was not a problem with Mathematica but with 3D acceleration within a virtual machine (my Linux setup: Ubuntu 12.04 running in VMware 8 on a Windows 7 host). After disabling hardware acceleration for the VM the plots with GraphicsRow now look OK.

 GraphicsRow[{a, a}, ImageSize -> Large]

Gaussian shown twice, without the offset

| improve this answer | |
  • $\begingroup$ Thanks for posting your solution. It would be helpful to future visitors if you would also attach an image of the problem to the question. $\endgroup$ – Mr.Wizard Dec 21 '12 at 15:07

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.