zoukankan      html  css  js  c++  java
  • Python画一朵花

    from mpl_toolkits.mplot3d import Axes3D
    from matplotlib import cm
    from matplotlib.ticker import LinearLocator
    
    from matplotlib.font_manager import FontProperties
    # 用于解决 Windows 系统,显示中文字体的问题
    font = FontProperties(fname=r"c:windowsfontssimsun.ttc", size=45)  
    
    import matplotlib.pyplot as plt
    import numpy as np
    
    fig = plt.figure()
    ax = fig.gca(projection='3d')
    
    [x , t] = np.meshgrid(np.array(range(25))/24.0,np.arange(0, 575.5,0.5)/575*17*np.pi - 2*np.pi)
    p = np.pi/2 * np.exp(-t/(8*np.pi))
    u = 1 - (1 - np.mod(3.6*t, 2 * np.pi)/np.pi) **4/2
    y = 2 * (x ** 2-x)**2*np.sin(p)
    r = u * (x*np.sin(p) + y * np.cos(p))
    
    surf = ax.plot_surface(r * np.cos(t),r * np.sin(t), u *(x*np.cos(p)-y*np.sin(p)),
               rstride = 10,cstride=10 ** 10,cmap = cm.gist_heat,linewidth=7,antialiased=True)
    
    plt.title(u'你好!',fontproperties=font)
    ax.set_xticks([])
    ax.set_yticks([])
    ax.set_zticks([])
    plt.show()
    

  • 相关阅读:
    HDU4112
    HDU1059 二进制拆分优化多重背包
    HDU1087
    HDU1978How Many Ways 记忆化dfs+dp
    HDU1160FatMouse's Speed
    HDU1503Advanced Fruits
    CF337C
    337BRoutine Problem
    【★★★★★模板专区★★★★★】
    【水】Jam计数法
  • 原文地址:https://www.cnblogs.com/q735613050/p/7701882.html
Copyright © 2011-2022 走看看