I use mapping to transform points on the surface of a cube into a sphere.
I want to build the surface of the resulting sphere and lines where the faces of the cube are displayed.
So far I have tried the following, working on one face of the cube at a time:
import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D def sphere_mapping(xbar,ybar,zbar): xx = xbar**2 yy = ybar**2 zz = zbar**2 x = xbar*np.sqrt(1 - yy/2 - zz/2 + yy*zz/3) y = ybar*np.sqrt(1 - xx/2 - zz/2 + xx*zz/3) z = zbar*np.sqrt(1 - xx/2 - yy/2 + xx*yy/3) return x,y,z fig = plt.figure() ax = fig.add_subplot(111,projection='3d',aspect='equal') sgrd1,sgrd2 = np.meshgrid(np.linspace(-1,1,100),np.linspace(-1,1,100)) sgrd3 = np.ones((100,100)) lgrd1 = np.hstack([np.linspace(-1,1,100),np.ones(100,),np.linspace(1,-1,100),-np.ones(100,)]) lgrd2 = np.hstack([np.ones(100,),np.linspace(1,-1,100),-np.ones(100,),np.linspace(-1,1,100)]) lgrd3 = np.ones(400,)
This works great. I get a sphere and I get thick black lines of edges. However, the lines are displayed across the surface of the sphere. 
If you change the display so that it simply xbar,ybar,zbar
, you will get the original cube and the rows displayed correctly. 
Any ideas why my lines show the scope and how to fix it?