Library: | graphic |
See also: | grpie grcoxcomb plotcoxcomb |
Quantlet: | dispcoxcomb | |
Description: | plots a coxcomb graph, a special pie chart, for which the frequency is proportional to the area of the corresponding segment and the angles of the segments are all equal. Consequently, the frequency is proportional to the square of the radius of the segment. |
Usage: | dispcoxcomb(disp, r, c, x, {col,} {text}) | |
Input: | ||
disp | display | |
r | scalar, row number of the plot in disp | |
c | scalar, column number of the plot in disp | |
x | n x p matrix of user data | |
col | p x 1 matrix defining the color of the plotted data | |
text | n x 1 matrix of text describing the segments |
library("plot") x=readm("crimwar") col=#(0,1,4) disp=createdisplay(2,2) dispcoxcomb(disp,1,1,x.double[1:6],col,x.text[1:6]) dispcoxcomb(disp,1,2,x.double[7:12],col,x.text[7:12]) dispcoxcomb(disp,2,1,x.double[13:18],col,x.text[13:18]) dispcoxcomb(disp,2,2,x.double[19:24],col,x.text[19:24])
This example generates four displays with different coxcomb plots in each plot using one of the original data sets of F. Nightingale. Each plot represents six months. The number of soldiers who died during the Crimean war due to injuries caused by the war is represented in black, those dying from diseases caused by the lack of hygienics are shown in blue and deaths due to other causales are plotted in red.