I've partially found the problem. I'm using plot3 in a script and call it after plotting several 2D graphs. If I plot the 3D graph first, it works fine. Interestingly, if I use the same plot3 call on the command line after the script has run (and given the error messages), it works.
I'm guessing the plotting parameters are being modified somewhere.