2
我正在使用matplotlib來將一些數據擬合到一個網格並將其繪製爲極座標投影。類似於下面的例子。不過,我希望它在地塊邊緣在0/360度相遇處平滑。任何人都知道我是怎麼做到的?griddata和極地圖
from pylab import *
import random
x = linspace(0, 360, 361).astype(int)
x = x*pi/180
y = linspace(0.05, 0.5, 800)
xgrid, ygrid = meshgrid(x, y)
baz = []
for c in range(2000): baz.append(random.randint(0,360))
freq = rand(len(baz))
pwr = rand(len(baz))
zgrid = griddata(baz,freq,pwr, xgrid, ygrid)
subplot(111, polar=True)
pcolormesh(xgrid, ygrid, zgrid)
show()
另外我處理的數據具有間隙由於通過的GridData創建的掩模(I使用的GridData如上但隨後在循環中總結許多網格)。我想填補缺失的部分(見附圖),有誰知道如何做到這一點?
感謝 戴夫
嗨,串聯是一個好主意,但是丟失的數據段來源於通過的GridData創造的面具,我不認爲有辦法解決它。所以,我在最後使用了一個不同的apprach [這裏] [http://stackoverflow.com/questions/13498172/matplotlib-polar-2d-histogram] – Dave