How do I limit a gnuplot polar to a 180 degree range?

前端 未结 1 1105
栀梦
栀梦 2020-12-18 08:15

I am attempting to use gnuplot to plot the off axis response of a loudspeaker in the range +/- 90 degrees. I have this working nicely, almost entirely as a result of Creatin

相关标签:
1条回答
  • 2020-12-18 08:57

    Gnuplot gets confused if you use xrange and yrange setting which contradict the rrange setting. Thats probably why the yrange settings are ignored.

    Then, you must also use set size ratio -1 in order to get the same scaling in x and yrange. When plotting only the upper two quadrants, you would get a wrong aspect ratio with set size square.

    set terminal pngcairo font ',10'
    
    set polar
    set angle degrees
    set size ratio 1
    set lmargin 8
    set style line 11 lc rgb 'gray80' lt -1
    set grid polar ls 11
    
    unset border
    unset tics
    
    set xrange [-1:1]
    set yrange [0:1]
    set size ratio -1
    
    r = 1
    set rtics 0.166 format '' scale 0
    set label '0°' center at first 0, first r*1.05
    set label '-90°' right at first -r*1.05, 0
    set label '+90°' left at first r*1.05, 0
    
    set for [i=1:5] label at first r*0.02, first r*((i/6.0) + 0.03) sprintf("%d dB", -30+(i*5))
    unset raxis
    
    set key outside top right
    
    set output 'polar.png'
    plot 'norm_polar_1000.txt' w lp ls 1 t '1k'
    

    enter image description here

    0 讨论(0)
提交回复
热议问题