2012-12-11 23 views
6

極座標で震度プロットを作成するにはどうすればよいですか?私はrとthetaに関してデータを持っています。私は試しました:極座標で震度プロットを作成する方法

import numpy as np 

radii = np.linspace(0.5,1,10) 
thetas = np.linspace(0,2*np.pi,20) 
theta, r = np.meshgrid(thetas, radii) 

f = plt.figure() 
ax = f.add_subplot(111, polar=True) 
ax.quiver(theta, r, dr, dt) 

ここで、drとdtは、rとθの方向のデータのベクトルです。

答えて

5

あなたのために変換が行われていないようです。あなたは(x、y)を行う必要がある - 手で>(R、T)の変換:

radii = np.linspace(0.5,1,10) 
thetas = np.linspace(0,2*np.pi,20) 
theta, r = np.meshgrid(thetas, radii) 

dr = 1 
dt = 1 

f = plt.figure() 
ax = f.add_subplot(111, polar=True) 
ax.quiver(theta, r, dr * cos(theta) - dt * sin (theta), dr * sin(theta) + dt * cos(theta)) 

graph

関連する問題