Skip to content

Instantly share code, notes, and snippets.

@amankharwal
Created September 14, 2020 04:19
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/40d24d9b26b95202635bb2a8bc463bfa to your computer and use it in GitHub Desktop.
Save amankharwal/40d24d9b26b95202635bb2a8bc463bfa to your computer and use it in GitHub Desktop.
# create data points
x = np.linspace(-10, 10, 100)
y = np.linspace(-15, 15, 100)
# create grid
X, Y = np.meshgrid(x, y)
Z = np.sin(X) + np.cos(Y)
fig = plt.figure(figsize=(9, 6))
ax = plt.axes(projection = '3d')
# hide the axis
ax._axis3don = False
# 3d contour plot
ax.contour3D(X, Y, Z, 100, cmap = 'viridis')
# make panel color white
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))
# make grid color white
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 point of view
ax.view_init(60, 90)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment