2017-04-21 86 views
1

我的數據是在極座標中,當我繪製它們並嘗試添加極座標網格時,它將成爲完整的圓形,但我的數據僅爲0-60度。如何限制gnuplot中的極座標網格?

我怎樣才能限制只從0-60度的網格,而不是一個完整的圓?

回答

0

我不知道這個內置功能。但是,作爲解決方法,可以使用multiplot來手動繪製網格線。 例如:

set term pngcairo enhanced size 800,800 
set output 'fig.png' 

set angles degrees 

set multiplot 

set lmargin at screen 0.1 
set tmargin at screen 0.9 
set rmargin at screen 0.9 
set bmargin at screen 0.1 

set samples 1000 
unset border 

R_max = 1 
dR = 0.2 

phi_max = 60. 
dphi = 15 

set xr [0:R_max] 
set yr [0:R_max] 

set xtics out nomirror 
unset ytics 

set style line 42 lc rgb '#666666' dt 3 

unset key 
plot \ 
    for [i=0:phi_max/dphi] (x>=0&&x<=R_max*cos(i*dphi))?tan(i*dphi)*x:1/0 w l ls 42 

set polar 
set trange [0:phi_max] 
unset raxis 
unset rtics 
plot \ 
    for [i=1:ceil(R_max/dR)] i*dR<=R_max?i*dR:1/0 w l ls 42 

unset raxis 
unset rtics 
plot cos(t) w l lw 2 lc rgb 'dark-red' 

生產: enter image description here

+0

非常感謝你,它幫助了很多。 如果可能,我還有一個問題。 我使用此代碼與網格繪製熱圖數據,和它完美的作品作爲鏈接 但它dosent填充的區域,如果我使用dgrid3d它會給我一個正方形。 我必須將我的數據從極地轉換爲笛卡爾,才能在此鏈接中使用splot ,您會發現這兩個圖表和我正在使用的代碼 https://mega.nz/#F!hcQEHbqR!NVxeSrFoy1-YcEbItzwnng 數據 0.0498099 \t \t 0.00435558 -568.242889 0.0996199 \t \t 0.00871117 -569.395867 0.14943 \t \t 0.0130668 -570.975623 0.19924 \t \t 0.0174223的-572.153443樣品 – user3552683