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

Python繪制3d螺旋曲線圖實(shí)例代碼

 更新時(shí)間:2017年12月20日 11:58:06   投稿:mengwei  
這篇文章主要介紹了Python繪制3d螺旋曲線圖實(shí)例代碼,具有一定借鑒價(jià)值,需要的朋友可以參考下。

Line plots

Axes3D.plot(xs, ys, *args, **kwargs)

繪制2D或3D數(shù)據(jù)

參數(shù) 描述
xs, ys X軸,Y軸坐標(biāo)定點(diǎn)
zs Z值,每一個(gè)點(diǎn)的值都是1
zdir 繪制2D集合時(shí)使用z的方向

其他的參數(shù):plot()

Python代碼:

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

mpl.rcParams['legend.fontsize'] = 10

fig = plt.figure()
ax = fig.gca(projection='3d')
theta = np.linspace(-4 * np.pi, 4 * np.pi, 100)
z = np.linspace(-2, 2, 100)
r = z**2 + 1
x = r * np.sin(theta)
y = r * np.cos(theta)
ax.plot(x, y, z, label='parametric curve')
ax.legend()

plt.show()

效果圖:

總結(jié)

以上就是本文關(guān)于Python繪制3d螺旋曲線圖實(shí)例代碼的全部?jī)?nèi)容,希望對(duì)大家有所幫助。感興趣的朋友可以繼續(xù)參閱本站其他相關(guān)專題。本文是從官網(wǎng)摘錄下來,參數(shù)部分如有描述不當(dāng),歡迎大家留言指出。

相關(guān)文章

最新評(píng)論