Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save MiguelAngelHFlores/48f54a0ecb4f2d7a250f6e7f9f2d585a to your computer and use it in GitHub Desktop.
Save MiguelAngelHFlores/48f54a0ecb4f2d7a250f6e7f9f2d585a to your computer and use it in GitHub Desktop.
from mpl_toolkits.mplot3d import Axes3D
from matplotlib import cm
from matplotlib.colors import LogNorm
import matplotlib.pyplot as plt
import numpy as np
fig = plt.figure()
ax = Axes3D(fig, azim = -120, elev = 58)
X = np.arange(-6, 6, 0.1)
Y = np.arange(-6, 6, 0.1)
X, Y = np.meshgrid(X, Y)
Z = X**2 + 2*Y**2
ax.plot_surface(X, Y, Z, rstride = 1, cstride = 1, norm = LogNorm(), cmap = cm.jet)
plt.xlabel("x")
plt.ylabel("y")
plt.title("Axis parallel hyper-ellipsoid function")
plt.savefig("Axis parallel hyper-ellipsoid function.PNG")
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment