1. Home
  2. DCIRCULAR procedure

DCIRCULAR procedure

Plots circular data (P.W. Goedhart & R.W. Payne).


PLOT = string tokens Information to be plotted (counts, kerneldensity, lines, mean, rose); default coun, mean, rose
TITLE = text Title for the graph; default * i.e. none
SEGMENT = scalar Width of sectors (in degrees) into which to group an ANGLES variates before plotting; default 20
MSEGMENT = scalar Defines the centre (in degrees) of the sectors; default 0
BANDWIDTH = scalar Bandwidth to use for the kernel density estimate; if this is unset, the value h0 suggested by Fisher (1993, page 26) is used
NGRID = scalar Defines the number of grid points for the kernel density estimate; default 180
WINDOW = scalar Window for the graph; default 3
SCREEN = string token Whether to clear screen before displaying the graph (keep, clear); default clea


ANGLES = factors or variates Directional observations to be plotted
GRID = variates Saves the grid (in degrees) on which the kernel density is estimated
DENSITY = variates Saves the kernel density estimate
SAVEBANDWIDTH = scalar Saves the calculated bandwidth h0 when BANDWIDTH is unset


DCIRCULAR plots data values that consist of directional observations recorded as angles between 0 and 360 degrees. The data values are supplied by the ANGLES parameter, in either a variate or a factor. With a variate, the observations are grouped for plotting into sectors of width specified (in degrees) by the SEGMENT option, with centres defined by the MSEGMENT option. The sectors are centred at MSEGMENT, MSEGMENT+SEGMENT, MSEGMENT+2*SEGMENT, and so on. The default value for SEGMENT and MSEGMENT is 20 and 0 respectively. If ANGLES is set to a factor, its levels define the midpoints of the sectors and these must be in clockwise order.

The graph contains a circle with marks at every 10 degrees, and labels at 0, 90, 180 and 270 degrees. The representations of the observations are determined by the settings supplied for the PLOT option as follows

    counts plots counts of the number of observations in each sector.
    kerneldensity plots estimates of the probability distribution of the data, using a quartic kernel function with bandwidth specified by the BANDWIDTH option. If BANDWIDTH is unset, a default is calculated based on the estimated concentration of the data (this is the value h0 suggested by Fisher, 1993, page 26). The kernel is calculated on a grid of values with number of values defined by the NGRID option.
    lines plots lines in each direction with lengths proportional to the number of observations in that direction.
    mean plots the mean vector (see Fisher 1993, page 31).
    rose plots a “rose” diagram in which the observations in each sector are represented as a triangle with apex at the centre of the circle and area proportional to the number of observations there.

By default PLOT=counts,mean,rose.

The options TITLE, WINDOW and SCREEN allow you to define a title for the plot, specify which window to use, and indicate whether or not to clear the screen beforehand. Parameters GRID, DENSITY and SAVEBANDWIDTH can be used to save the grid (in degrees), kernel estimate and bandwidth h0. The latter is saved only when BANDWIDTH is unset.




DCIRCULAR uses Genstat’s standard graphics and calculation commands. The underlying methodology is described by Fisher (1993).

Action with RESTRICT

If ANGLES is restricted, only the unrestricted units are plotted.


Fisher, N.I. (1993). Statistical Analysis of Circular Data. Cambridge University Press, Cambridge.

See also


Commands for: Graphics.


CAPTION 'DCIRCULAR example',!t(\
        'Directions chosen by 100 ants in response to an evenly illuminated',\
        'black target placed at 180 degrees (see Fisher 1993, page 61).');\ 
VARIATE [NVALUES=100] Direction
READ    Direction
  330 290 60  200 200 180 280 220 190 180
  180 160 280 180 170 190 180 140 150 150
  160 200 190 250 180 30  200 180 200 350
  200 180 120 200 210 130 30  210 200 230
  180 160 210 190 180 230 50  150 210 180
  190 210 220 200 60  260 110 180 220 170
  10  220 180 210 170 90  160 180 170 200
  160 180 120 150 300 190 220 160 70  190
  110 270 180 200 180 140 360 150 160 170
  140 40  300 80  210 200 170 200 210 190 :
DCIRCULAR [TITLE='Directions chosen by 100 ants.'] Direction
Updated on March 8, 2019

Was this article helpful?