最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

python繪制玫瑰花情人節(jié)表白

 更新時(shí)間:2022年06月29日 16:02:18   作者:腦殼二  
這篇文章主要介紹了python繪制玫瑰花,文章基于python的相關(guān)資料展開(kāi)主題詳細(xì)介紹,具有一定的參考價(jià)值,想情人節(jié)花式表白的小伙伴可以參考一下喲

一、玫瑰花繪制—深紅色

import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
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 * 30 * np.pi - 4*np.pi)
p = (np.pi / 2) * np.exp(-t / (8 * np.pi))
change = np.sin(20*t)/50
u = 1 - (1 - np.mod(3.3 * t, 2 * np.pi) / np.pi) ** 4 / 2 + change
y = 2 * (x ** 2 - x) ** 2 * np.sin(p)
r = u * (x * np.sin(p) + y * np.cos(p)) * 1.5
h = u * (x * np.cos(p) - y * np.sin(p))
c= plt.get_cmap('magma')
surf = ax.plot_surface(r * np.cos(t), r * np.sin(t), h, rstride=1, cstride=1,
                       cmap= c, linewidth=0, antialiased=True)
plt.show()

二、玫瑰花繪制—五顏六色

import numpy as np
import matplotlib.pyplot as plt
from matplotlib import cm
from mpl_toolkits.mplot3d import Axes3D

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))
h = u * (x * np.cos(p) - y * np.sin(p))
c= cm.gist_rainbow_r
surf = ax.plot_surface(r * np.cos(t), r * np.sin(t), h, rstride=1, cstride=1,
                       cmap= c, linewidth=0, antialiased=True)
plt.show()

三、玫瑰花繪制—粉紅色

import numpy as np
import matplotlib.pyplot as plt
from matplotlib import cm
from mpl_toolkits.mplot3d import Axes3D

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))
h = u * (x * np.cos(p) - y * np.sin(p))
c= cm.get_cmap('spring_r')
surf = ax.plot_surface(r * np.cos(t), r * np.sin(t), h, rstride=1, cstride=1,
                       cmap= c, linewidth=0, antialiased=True)
plt.show()

四、玫瑰花繪制—紅色

# 省略了頭文件,可以在之前的博客里看到
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
fig = plt.figure()
ax = fig.gca(projection='3d')
# 將相位向后移動(dòng)了6*pi
[x, t] = np.meshgrid(np.array(range(25)) / 24.0, np.arange(0, 575.5, 0.5) / 575 * 20 * np.pi + 4*np.pi)
p = (np.pi / 2) * np.exp(-t / (8 * np.pi))
# 添加邊緣擾動(dòng)
change = np.sin(15*t)/150
# 將t的參數(shù)減少,使花瓣的角度變大
u = 1 - (1 - np.mod(3.3 * t, 2 * np.pi) / np.pi) ** 4 / 2 + change
y = 2 * (x ** 2 - x) ** 2 * np.sin(p)
r = u * (x * np.sin(p) + y * np.cos(p))
h = u * (x * np.cos(p) - y * np.sin(p))
c= plt.get_cmap('Reds')
surf = ax.plot_surface(r * np.cos(t), r * np.sin(t), h, rstride=1, cstride=1,
                       cmap= c, linewidth=0, antialiased=True)
plt.show()

五、桃花繪制

import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
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 * 6 * np.pi - 4*np.pi)
p = (np.pi / 2) * np.exp(-t / (8 * np.pi))
change = np.sin(10*t)/20
u = 1 - (1 - np.mod(5.2 * t, 2 * np.pi) / np.pi) ** 4 / 2 + change
y = 2 * (x ** 2 - x) ** 2 * np.sin(p)
r = u * (x * np.sin(p) + y * np.cos(p)) * 1.5
h = u * (x * np.cos(p) - y * np.sin(p))
c= plt.get_cmap('spring_r')
surf = ax.plot_surface(r * np.cos(t), r * np.sin(t), h, rstride=1, cstride=1,
                       cmap= c, linewidth=0, antialiased=True)
plt.show()

到此這篇關(guān)于python繪制玫瑰花情人節(jié)表白的文章就介紹到這了,更多相關(guān)python繪制玫瑰花內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

相關(guān)文章

  • 詳解python中mongoengine庫(kù)用法

    詳解python中mongoengine庫(kù)用法

    這篇文章主要介紹了python中mongoengine庫(kù)用法,主要包括MongoDB的安裝與連接過(guò)程,本文給大家介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下
    2022-07-07
  • python實(shí)現(xiàn)不同數(shù)據(jù)庫(kù)間數(shù)據(jù)同步功能

    python實(shí)現(xiàn)不同數(shù)據(jù)庫(kù)間數(shù)據(jù)同步功能

    這篇文章主要介紹了python實(shí)現(xiàn)不同數(shù)據(jù)庫(kù)間數(shù)據(jù)同步功能,本文給大家介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下
    2021-02-02
  • 利用Python繪制隨機(jī)游走圖的詳細(xì)過(guò)程

    利用Python繪制隨機(jī)游走圖的詳細(xì)過(guò)程

    隨機(jī)游走(random walk)也稱隨機(jī)漫步,隨機(jī)行走等,是以隨機(jī)的方式采取連續(xù)步驟的過(guò)程,下面這篇文章主要給大家介紹了關(guān)于利用Python繪制隨機(jī)游走圖的相關(guān)資料,文中通過(guò)代碼介紹的非常詳細(xì),需要的朋友可以參考下
    2024-02-02
  • Python中的__init__作用是什么

    Python中的__init__作用是什么

    在本篇文章里小編給大家分享的是關(guān)于Python中的__init__作用以及相關(guān)用法內(nèi)容,需要的朋友們可以學(xué)習(xí)下。
    2020-06-06
  • PythonWeb項(xiàng)目Django部署在Ubuntu18.04騰訊云主機(jī)上

    PythonWeb項(xiàng)目Django部署在Ubuntu18.04騰訊云主機(jī)上

    這篇文章主要介紹了PythonWeb項(xiàng)目Django部署在Ubuntu18.04騰訊云主機(jī)上的相關(guān)知識(shí),本文通過(guò)代碼加文字說(shuō)明的形式給大家介紹的非常詳細(xì),具有一定的參考借鑒價(jià)值 ,需要的朋友可以參考下
    2019-04-04
  • python如何爬取網(wǎng)站數(shù)據(jù)并進(jìn)行數(shù)據(jù)可視化

    python如何爬取網(wǎng)站數(shù)據(jù)并進(jìn)行數(shù)據(jù)可視化

    這篇文章主要介紹了python爬取拉勾網(wǎng)數(shù)據(jù)并進(jìn)行數(shù)據(jù)可視化,爬取拉勾網(wǎng)關(guān)于python職位相關(guān)的數(shù)據(jù)信息,并將爬取的數(shù)據(jù)已csv各式存入文件,然后對(duì)csv文件相關(guān)字段的數(shù)據(jù)進(jìn)行清洗,并對(duì)數(shù)據(jù)可視化展示,包括柱狀圖展示、直方圖展示,需要的朋友可以參考下
    2019-07-07
  • 深入探究python中Pandas庫(kù)處理缺失數(shù)據(jù)和數(shù)據(jù)聚合

    深入探究python中Pandas庫(kù)處理缺失數(shù)據(jù)和數(shù)據(jù)聚合

    在本篇文章中,我們將深入探討Pandas庫(kù)中兩個(gè)重要的數(shù)據(jù)處理功能:處理缺失數(shù)據(jù)和數(shù)據(jù)聚合,文中有詳細(xì)的代碼示例,對(duì)我們的學(xué)習(xí)或工作有一定的幫助,需要的朋友可以參考下
    2023-07-07
  • pandas pivot_table() 按日期分多列數(shù)據(jù)的方法

    pandas pivot_table() 按日期分多列數(shù)據(jù)的方法

    今天小編就為大家分享一篇pandas pivot_table() 按日期分多列數(shù)據(jù)的方法,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過(guò)來(lái)看看吧
    2018-11-11
  • 使用python socket分發(fā)大文件的實(shí)現(xiàn)方法

    使用python socket分發(fā)大文件的實(shí)現(xiàn)方法

    今天小編就為大家分享一篇使用python socket分發(fā)大文件的實(shí)現(xiàn)方法,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過(guò)來(lái)看看吧
    2019-07-07
  • jupyter notebook 調(diào)用環(huán)境中的Keras或者pytorch教程

    jupyter notebook 調(diào)用環(huán)境中的Keras或者pytorch教程

    這篇文章主要介紹了jupyter notebook 調(diào)用環(huán)境中的Keras或者pytorch教程,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過(guò)來(lái)看看吧
    2020-04-04

最新評(píng)論

泗水县| 满城县| 永城市| 济源市| 南投市| 稷山县| 锡林浩特市| 三都| 海安县| 惠州市| 安化县| 安龙县| 阳曲县| 浦城县| 昌邑市| 咸丰县| 保山市| 张家界市| 华池县| 弥勒县| 乌鲁木齐县| 自贡市| 璧山县| 同德县| 博兴县| 安义县| 平乡县| 九龙坡区| 缙云县| 陇川县| 伊川县| 庆城县| 泉州市| 彰化市| 常山县| 文山县| 濮阳市| 安岳县| 两当县| 财经| 兰溪市|