Skip to content

Instantly share code, notes, and snippets.

@tmwatchanan
Created February 24, 2021 19:19
Show Gist options
  • Save tmwatchanan/dd1a45475470bb53dc371a00cd1be632 to your computer and use it in GitHub Desktop.
Save tmwatchanan/dd1a45475470bb53dc371a00cd1be632 to your computer and use it in GitHub Desktop.
surf = ax.plot_surface(X, Y, Z, rstride=1, cstride=1, antialiased=True, facecolors=facecolors, shade=True, linewidth=.5, edgecolor="black")
surf.set_edgecolor('k')
beaitufy_3d(ax)
################################################################################
def beautify_3d(ax):
ax.grid(False)
z_ticks = [t for t in ax.get_zticks() if t >= 0]
ax.set_zticks(z_ticks)
ax.xaxis.pane.set_edgecolor('black')
ax.yaxis.pane.set_edgecolor('black')
ax.zaxis.pane.set_edgecolor('black')
ax.xaxis.pane.fill = False
ax.yaxis.pane.fill = False
ax.zaxis.pane.fill = False
ax.xaxis._axinfo['tick']['inward_factor'] = 0
ax.xaxis._axinfo['tick']['outward_factor'] = 0.3
ax.yaxis._axinfo['tick']['inward_factor'] = 0
ax.yaxis._axinfo['tick']['outward_factor'] = 0.3
ax.zaxis._axinfo['tick']['inward_factor'] = 0
ax.zaxis._axinfo['tick']['outward_factor'] = 0.3
ax.zaxis._axinfo['tick']['outward_factor'] = 0.3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment