Skip to content

Instantly share code, notes, and snippets.

@amankharwal
Created September 14, 2020 04:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amankharwal/0ca656164b9c9a00f51698671a66c84a to your computer and use it in GitHub Desktop.
Save amankharwal/0ca656164b9c9a00f51698671a66c84a to your computer and use it in GitHub Desktop.
for angle in range(0,360,2):
plt.figure(figsize=(16, 9))
ax = plt.axes(projection = '3d')
ax._axis3don = False
# 3d contour plot
ax.contour3D(X, Y, Z, 200, cmap = 'viridis')
ax.xaxis.set_pane_color((1.0, 1.0, 1.0, 0.0))
ax.yaxis.set_pane_color((1.0, 1.0, 1.0, 0.0))
ax.zaxis.set_pane_color((1.0, 1.0, 1.0, 0.0))
ax.xaxis._axinfo['grid']['color'] = (1, 1, 1, 0)
ax.yaxis._axinfo['grid']['color'] = (1, 1, 1, 0)
ax.zaxis._axinfo['grid']['color'] = (1, 1, 1, 0)
# adjust view from 0, 2, 4, 6, ..., 360
ax.view_init(60, angle)
# save figure with different names depend on the view
filename='3d/3d_vis_'+str(angle)+'.png'
plt.savefig(filename, dpi=75)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment