Created
July 6, 2019 01:21
-
-
Save MiguelAngelHFlores/9b00a9a02e8faa9e4a388c6218f074b2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 = -128, elev = 52) | |
X = np.arange(-4.5, 4.5, 0.1) | |
Y = np.arange(-4.5,4.5, 0.1) | |
X, Y = np.meshgrid(X, Y) | |
Z = (1.5-X+X*Y)**2+(2.25-X+X*Y**2)**2+(2.625-X+X*Y**3)**2 | |
ax.plot_surface(X, Y, Z, rstride = 1, cstride = 1, norm = LogNorm(), cmap = cm.jet) | |
plt.xlabel("x") | |
plt.ylabel("y") | |
plt.title("Beale function") | |
plt.savefig("Beale function.PNG") | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment