Python PIL TIFF:
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
import numpy as np
from PIL import Image
import io
fig = plt.figure(figsize=(5,5), dpi=300)
ax = fig.gca(projection='3d')
ax.set_xlim([-1,1])
ax.set_ylim([-1,1])
ax.set_zlim([-1,1])
ax.axes.xaxis.set_ticklabels([])
ax.axes.yaxis.set_ticklabels([])
ax.axes.zaxis.set_ticklabels([])
xx, yy = np.meshgrid(range(-1,2), range(-1,2))
zz = np.zeros(shape=(3,3))
ax.plot_surface(xx, yy, zz, color='#c8c8c8', alpha=0.3)
ax.plot_surface(xx, zz, yy, color='#b6b6ff', alpha=0.2)
ax.scatter([0],[0],[0], color='b', s=200)
png1 = io.BytesIO()
fig.savefig(png1, format="png")
png2 = Image.open(png1)
png2.save("3dPlot.tiff")
png1.close()
Python 2.x, cStringIO BytesIO :
import cStringIO
png1 = cStringIO.StringIO()