0

I need help with my polar plot shown below.

enter image description here

The plot was generated using the same code as in GNUPlot - Plotting a data set in polar form (r, θ, T(r,θ)) to a contour/heat map.

The code plot the whole of quadrant 1, but I only want the plot from 0 to 60 degrees, for radius up to 3000. Can anyone help to suggest which part of the code that I should change? Or what software that I can use to clean the unnecessary areas?

Thank you in advance.

theozh
  • 22,244
  • 5
  • 28
  • 72
mh koh
  • 1
  • Welcome to StackOverflow! I am not sure whether you can do this easily or whether you have to draw your axes yourself with lines and arcs. In order to limit your heatmap data to the 60 degrees segment, the following feature in gnuplot 5.5. might be helpful: http://gnuplot.sourceforge.net/demo_5.5/mask_pm3d.html – theozh Jun 23 '22 at 04:38
  • Can you please provide some example data you want to plot? – theozh Jun 23 '22 at 08:35

1 Answers1

0

Apparently, you can limit the polar graph to a quadrant. However, I haven't found out how to get an other section than a quadrant. So, maybe you have to draw it "manually"?

Check the following example as starting point.

Script:

### show only a section of a polar graph
reset session

set angle degrees
set size ratio 1
set margins 0,0,0,0
set origin 0.05,0.1
set size 0.9,0.9
set border 1
unset ytics
set xtics nomirror

# create some test data
set print $Data
    do for [i=1:100] { print sprintf("%g %g",0.6+0.3*cos(7.2*i),i*0.6) }
set print

# draw polar graph "manually"
rmax   = 1
rstep  = 0.2
rcount = int(real(rmax)/rstep)+1
set xrange [0:rmax]
set yrange [0:rmax]
set for [r=1:rcount]  obj 1+r circ at 0,0 size r*rstep arc [0:60] fc rgb r<rcount?0x777777:0x000000 dt r==rcount?1:3
amax     = 60
astep    = 10
acount   = amax/astep
astepMin = 1
set for [a=0:acount] arrow 1+a  \
    from 0,0 angle a*astep length rmax lc rgb a<acount?0x777777:0x000000 dt a==acount?1:3 nohead 
set for [a=0:amax:astepMin] arrow 1000+a \
    from rmax*cos(a), rmax*sin(a) angle 180+a length rmax/100. lc "black" nohead 
roff = 1.03      # factor for label offset
set for [a=0:amax:astep] label 1+a  at cos(a)*rmax*roff, sin(a)*rmax*roff sprintf("%g°",a) center

# conversion polar to cartesian
xPtC(colR,colA) = column(colR)*cos(column(colA))
yPtC(colR,colA) = column(colR)*sin(column(colA))

plot $Data u (xPtC(1,2)):(yPtC(1,2)) w l lw 2 lc "red" ti "Data"
### end of script

Result:

enter image description here

theozh
  • 22,244
  • 5
  • 28
  • 72