import numpy as np
import matplotlib.pyplot as plt

x = np.linspace(-8 , 8, 1024)
y1 = 0.618*np.abs(x) - 0.8* np.sqrt(64-x**2)
y2 = 0.618*np.abs(x) + 0.8* np.sqrt(64-x**2)
plt.plot(x, y1, color = 'r')
plt.plot(x, y2, color = 'r')
plt.show()

4 条评论

  • @ 2017-11-28 09:45:50

    傻子

  • @ 2017-11-28 09:45:50

    傻子

  • @ 2017-11-28 09:45:44

    傻子

  • @ 2017-11-27 18:22:53

    from mpl_toolkits.mplot3d import Axes3D
    import matplotlib.pyplot as plt
    from matplotlib import cm
    from matplotlib.ticker import LinearLocator, FormatStrFormatter
    import numpy as np

    fig = plt.figure()
    ax = fig.gca(projection='3d')

    Make data.

    X = np.arange(-5, 5, 0.25)
    Y = np.arange(-5, 5, 0.25)
    X, Y = np.meshgrid(X, Y)
    R = np.sqrt(X**2 + Y**2)
    Z = np.sin(R)

    Plot the surface.

    surf = ax.plot_surface(X, Y, Z, cmap=cm.coolwarm,
    linewidth=0, antialiased=False)

    Customize the z axis.

    ax.set_zlim(-1.01, 1.01)
    ax.zaxis.set_major_locator(LinearLocator(10))
    ax.zaxis.set_major_formatter(FormatStrFormatter('%.02f'))

    Add a color bar which maps values to colors.

    fig.colorbar(surf, shrink=0.5, aspect=5)

    plt.show()

  • 1

信息

难度
1
分类
(无)
标签
(无)
递交数
7368
已通过
1213
通过率
16%
被复制
7
上传者