visualization - Draw an annulus segment in GNUPlot -


i shade specific region in polar plot using gnuplot. region bounded limits in r (r1, r2) , theta (t1, t2), final shape annulus segment defined 4 points in polar space.

in cartesian plot, quite easy draw rectangle, either (set object rect) or filledcurve of closed shape 4 vertices. however, filledcurve shape specified 4 points in polar plot still results in quadrilateral (lines constant r should circular arcs, not straight lines).

is there simple or straightforward way plot shape in polar coordinates? i've tried using 2 arcs , filling space between them, has not been working correctly far , i'm not sure if there's better way go this.

unfortunately, not easy. can set circle object specify begin , end angles. cut out center part must draw second white circle above:

set xrange [-1:1] set yrange [-1:1] set size ratio -1  r1 = 0.5 r2 = 1 theta1 = -30 theta2 = 60  set angles degrees set style fill solid noborder set object circle @ first 0,0 front size r2 arc [theta1:theta2] fillcolor lt 1 set object circle @ first 0,0 front size r1 fillcolor rgb 'white'  plot -10 notitle 

here essential, x , y axis have same unit (set size ratio -1), because circle object defined in units of first x-axis , not respect y-axis @ all. if don't have else plot, must use plot command plots outside of defined ranges. without plot objects aren't drawn.

the result 4.6.5 is:

enter image description here

with upcoming 5.0 version can use pseudo-data (with special file name +) filledcurves plotting style:

r1 = 0.5 r2 = 1.0 theta1 = 20 theta2 = 135 set polar set angles degrees set size ratio -1 unset raxis unset rtics set trange [theta1:theta2] set style fill solid noborder plot '+' using 1:(r1):(r2) filledcurves notitle 

enter image description here


Comments

Popular posts from this blog

java - How to specify maven bin in eclipse maven plugin? -

single sign on - Logging into Plone site with credentials passed through HTTP -

php - Why does AJAX not process login form? -