Description Usage Arguments Examples
This function draw a pie chart at specified locations on a map.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
x |
x coordinate of where the pie will be plotted |
y |
y coordinate of where the pie will be plotted |
values |
the values that will become the percentages of the pie. |
sizes |
the size of each pie. |
edges |
the number of increments used to describe the circle of the pie. |
clockwise |
whether the divisions are in clockwise order. |
init.angle |
where the pie starts te divisions |
col |
pie colors (length must be the same as ncol values) |
border |
border color(s) of the pies |
... |
passed to default plot function |
1 2 3 4 5 6 7 8 | data(SainteMarie85)
grains$SymSizes <- grains$SiloCount*8 #specify symbol sizes in map units
plotmat <- arrangeSymbols(grains, grains$SymSizes) #alternative pie locations
flines <- flylines(coordinates(grains)[,1],coordinates(grains)[,2],plotmat[,1],plotmat[,2]) #fly-lines from real locations to pie locations.
plot(boghar, col="grey75", border=NA, axes=TRUE, main="Barley (brown) and wheat (yellow)\nin 19th grain silos (Boghar, Algeria)") #background map
lines(flines, lwd=0.5) #fly-lines
pieSymbols(x=plotmat[,1], y=plotmat[,2], values=grains@data[,c("BarleyHL","WheatHL")], sizes=grains$SymSizes, col=c("saddlebrown","yellow")) #pies
points(grains, pch=19, cex=0.3, col="black") #real locations
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.