1. Home
  2. DYPOLAR procedure

DYPOLAR procedure

Produces polar plots (D. B. Baird).

Options

MODULUS = scalar Number of units required to give a complete revolution in X; default 360
TOPANGLE = scalar Angle at the top of the plot; default is a quarter of the MODULUS
COLOUR = scalar or text Colour for the lines marking rings and sectors; default 'black'
LINESTYLE = scalar Linestyle for the lines marking rings and sectors; default 1
YORIGIN = scalar Origin for the y-values; default 0 or the minimum of Y if this is less than 0
YMARKS = variate Y-values for the rings, plotted in the background of the plot
XMARKS = variate X-values for the lines marking the sectors, plotted in the background of the plot
YLABELS = text Labels for the rings
XLABELS = text Labels for the sectors
YTRANSFORM = string token Transformed scale for the y-values (identity, log, log10, logit, probit, cloglog, square, exp, exp10, ilogit, iprobit, icloglog, root); default is to use the transform defined for YAXIS
NRINGS = scalar Number of rings to be plotted, if YMARKS is not set; default 9
NSECTORS = scalar Number of sectors to be plotted, if XMARKS is not set; default 12
WINDOW = scalar Window number for the graph; default 1
KEYWINDOW = scalar Window number for the graph key; default 2
SCREEN = string token Whether to clear the screen before the plot (clear, keep); default clea
KEYDESCRIPTION = text Overall description for the key; default *

Parameters

Y = variates, factors or pointers Y-values specifying the amplitudes of the points
X = variates, factors or pointers X-values specifying the angles of the points
GROUPS = factors Factor to divide the points into groups; default * i.e. none
TITLE = texts Title for the graph; default forms a title automatically with the names of the Y and X structures
PEN = scalar or variates Pens used to plot the data; default 1
DESCRIPTION = texts Annotation for key; default uses the names of the Y and X structures, or the labels of GROUPS if set

Description

DYPOLAR produces polar plots, using high-resolution graphics. The data to be plotted are specified by the Y and X parameters. To plot several sets of data on the same plot, you can set Y and/or X to a pointer containing several variates or factors. Alternatively, you can use the GROUPS parameter to supply a factor to identify groups of points that are to be plotted separately.

In the plot, the X values are converted to angles (by dividing by MODULUS, and multiplying by 360 degrees). The Y values define the amplitudes of the points. An example might be to plot a time series of observations against the day of the week, month or year.

The TOPANGLE option defines the angle at the top of the plot. By default this is a quarter of the MODULUS, so that the angle zero is plotted horizontally, from left to right. The YORIGIN option defines the y-value to be used as the origin of the polar plot. By default this is zero, or the minimum of Y if this is less than zero.

The PEN parameter specifies the pens to be used to plot the data, and thus defines the method, symbols, colours etc. (See the PEN directive for more details.) The setting should be a scalar if a single set of points is to be plotted, or a variate with a value for each set if there are several.

The Y values can be transformed by using the YTRANSFORM option. The settings are the same as those of the TRANSFORM option of YAXIS. If this is not set, DYPOLAR uses the setting of the TRANSFORM option, defined by the YAXIS directive for the specified WINDOW.

Some rings and sectors are plotted in the background of the plot, to provide a sense of scale. You can specify a number of rings to display at regular intervals, by setting the NRINGS option. Similarly, the NSECTORS option allows you to specify a number of regularly spaced sectors. Alternatively, you can define the positions of the background rings and sectors explicitly, by setting the YMARKS or XMARKS options, respectively. You can provide the labels for the rings and sectors by using the YLABELS and XLABELS options (and the number of labels must match the number of rings and sectors that have been requested). The line styles and colours of the rings and sectors are controlled by the LINESTYLE and COLOUR options. You can use the XAXIS and YAXIS directives, prior to DYPOLAR, to set attributes and titles for the outside ring and the amplitude scale of the plot, respectively.

The TITLE parameter allows you to supply an overall title for the plot. You can use the DESCRIPTION parameter to provide labels for the key. If Y or X is a pointer, DESCRIPTION should contain the same number of items as the pointer or, if GROUPS is set, it should contain the same number of items as the number of groups.

The WINDOW and KEYWINDOW options specify the numbers of the windows to use for the plot and key respectively, and the SCREEN option controls whether the screen is cleared first, in the usual way (see DGRAPH). You can specify a title for the key using the KEYDESCRIPTION option.

Options: MODULUS, TOPANGLE, COLOUR, LINESTYLE, YORIGIN, YMARKS, XMARKS, YLABELS, XLABELS, YTRANSFORM, NRINGS, NSECTORS, WINDOW, KEYWINDOW, SCREEN, KEYDESCRIPTION.

Parameters: Y, X, GROUPS, TITLE PEN, DESCRIPTION.

Action with RESTRICT

If any of the variates or factors are restricted, only the units not excluded by the restriction will be plotted.

See also

Directives: DGRAPH, XAXIS, YAXIS, PEN.

Procedures: CASSOCIATION, CDESCRIBE, DCIRCULAR, RCIRCULAR, WINDROSE.

Commands for: Graphics.

Example

CAPTION       'DYPOLAR example','Temperature vs. day in the year';\
              STYLE=major,plain
SPLOAD        [PRINT=*] '%DATA%/Weather90-95.gsh'
CALCULATE     DayinYear = NDAYINYEAR(Date)
GROUPS       [REDEFINE=yes] DayinYear
TABULATE     [CLASS=DayinYear] TempMax; MEAN=TMax
VTABLE       TMax; VARIATE=MeanMax; CLASS=!P(DayYr)
GETATTRIBUTE [ATTRIBUTE=labels] Month; pMth
CALCULATE    XMarks = NDAYINYEAR(DATE(!(12(1));!(1...12);1990))
PEN          1,2; METHOD=point,line; SYMBOL='circle',0;\
             COLOUR='blue','red'; THICKNESS=2
XAXIS        1; TITLE='Day in the year'
YAXIS        1; TITLE='Maximum Temperature (~^{O}C)'
DYPOLAR      [MODULUS=365; TOPANGLE=1; XMARKS=XMarks; XLABELS=pMth['labels']]\
             !p(TempMax,MeanMax); X=!P(DayinYear,DayYr); PEN=!(1,2);\
             TITLE='Maximum Temperature around the year';\
             DESCRIPTION=!t('Observations','Means')
Updated on June 19, 2019

Was this article helpful?