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

Python+matplotlib實(shí)現(xiàn)填充螺旋實(shí)例

 更新時(shí)間:2018年01月15日 15:36:21   投稿:mengwei  
這篇文章主要介紹了Python+matplotlib實(shí)現(xiàn)填充螺旋實(shí)例,具有一定借鑒價(jià)值,需要的朋友可以參考下

填充螺旋演示結(jié)果:

實(shí)例代碼:

import matplotlib.pyplot as plt
import numpy as np

theta = np.arange(0, 8*np.pi, 0.1)
a = 1
b = .2

for dt in np.arange(0, 2*np.pi, np.pi/2.0):

  x = a*np.cos(theta + dt)*np.exp(b*theta)
  y = a*np.sin(theta + dt)*np.exp(b*theta)

  dt = dt + np.pi/4.0

  x2 = a*np.cos(theta + dt)*np.exp(b*theta)
  y2 = a*np.sin(theta + dt)*np.exp(b*theta)

  xf = np.concatenate((x, x2[::-1]))
  yf = np.concatenate((y, y2[::-1]))

  p1 = plt.fill(xf, yf)

plt.show()

總結(jié)

以上就是本文關(guān)于Python+matplotlib實(shí)現(xiàn)填充螺旋實(shí)例的全部內(nèi)容,希望對(duì)大家有所幫助。感興趣的朋友可以繼續(xù)參閱本站其他相關(guān)專題,如有不足之處,歡迎留言指出。感謝朋友們對(duì)本站的支持!

相關(guān)文章

最新評(píng)論