欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

python編程實(shí)現(xiàn)隨機(jī)生成多個(gè)橢圓實(shí)例代碼

 更新時(shí)間:2018年01月03日 15:33:08   投稿:mengwei  
這篇文章主要介紹了python編程實(shí)現(xiàn)隨機(jī)生成多個(gè)橢圓實(shí)例代碼,具有一定借鑒價(jià)值,需要的朋友可以參考下

橢圓演示:

代碼示例:

import matplotlib.pyplot as plt
import numpy as np
from matplotlib.patches import Ellipse

NUM = 250

ells = [Ellipse(xy=np.random.rand(2) * 10,
    width=np.random.rand(), height=np.random.rand(),
    angle=np.random.rand() * 360)
  for i in range(NUM)]

fig, ax = plt.subplots(subplot_kw={'aspect': 'equal'})
for e in ells:
 ax.add_artist(e)
 e.set_clip_box(ax.bbox)
 e.set_alpha(np.random.rand())
 e.set_facecolor(np.random.rand(3))

ax.set_xlim(0, 10)
ax.set_ylim(0, 10)

plt.show()

總結(jié)

以上就是本文關(guān)于python編程實(shí)現(xiàn)隨機(jī)生成多個(gè)橢圓實(shí)例代碼的全部?jī)?nèi)容,希望對(duì)大家有所幫助。感興趣的朋友可以繼續(xù)參閱本站其他相關(guān)專題,如有不足之處,歡迎留言指出。感謝朋友們對(duì)本站的支持!

相關(guān)文章

最新評(píng)論