I would like to shade a specific region in a polar plot using GNUPlot. This region is bounded by limits in R (r1, r2) and Theta (t1, t2), so the final shape is an annulus segment defined by only 4 points in polar space.
In a Cartesian plot, it is quite easy to draw a rectangle, either by (set object rect)
or filledcurve
of a closed shape with 4 vertices. However, a filledcurve shape specified by 4 points in a polar plot still results in a quadrilateral (lines with constant R should be circular arcs, not straight lines).
Is there a simple or straightforward way to plot this shape in polar coordinates? I've tried using two arcs and then filling the space between them, but this has not been working correctly so far and I'm not sure if there's a better way to go about this.
Unfortunately, that is not too easy. You can set a
circle
object for which you specify the begin and end angles. To cut out the center part you must draw a second white circle above:Here it is essential, that x and y axis have the same unit (
set size ratio -1
), because a circle object is defined in units of the first x-axis and does not respect the y-axis at all. If you don't have anything else to plot, you must use aplot
command which plots something outside of the defined ranges. Without a plot the objects aren't drawn.The result with 4.6.5 is:
With the upcoming 5.0 version you can use pseudo-data (with the special file name
+
) together with thefilledcurves
plotting style: