Title: | Doughnut Plots |
---|---|
Description: | A simple implementation of doughnut plots - pie charts with a blank center. The package is named after Homer Simpson - arguably the best-known lover of doughnuts. |
Authors: | Lawrence Hudson |
Maintainer: | Lawrence Hudson <[email protected]> |
License: | GPL-2 |
Version: | 0.1-4 |
Built: | 2025-02-12 03:54:54 UTC |
Source: | https://github.com/quicklizard99/homeric |
A simple implementation of doughnut plots - pie charts with a blank center. The package is named after Homer Simpson - arguably the best-known lover of doughnuts.
Package: | Homeric |
Type: | Package |
Title: | Doughnut Plots |
Version: | 0.1-4 |
Date: | 2016-07-11 |
Author: | Lawrence Hudson |
Maintainer: | Lawrence Hudson <[email protected]> |
Description: | A simple implementation of doughnut plots - pie charts with a blank center. The package is named after Homer Simpson - arguably the best-known lover of doughnuts. |
License: | GPL-2 |
URL: | https://github.com/quicklizard99/Homeric/ |
Repository: | https://quicklizard99.r-universe.dev |
RemoteUrl: | https://github.com/quicklizard99/homeric |
RemoteRef: | HEAD |
RemoteSha: | 41244e05c680e91e6fe38d2c82fcd746461f7e5f |
Index of help topics:
Homeric-package Doughnut Plots PlotDoughnut Plot doughnut
Lawrence Hudson Maintainer: Lawrence Hudson <[email protected]>
par(mar=rep(0,4), oma=rep(0, 4)) PlotDoughnut(1:5)
par(mar=rep(0,4), oma=rep(0, 4)) PlotDoughnut(1:5)
Plot values as a doughnut.
PlotDoughnut( values, clockwise=TRUE, origin.degrees=0, radius=1, thickness=0.5, frame.plot=FALSE, xlim=c(-radius, radius), ylim=c(-radius, radius), col=NULL, n=2500, centre.text=NULL, centre.cex=par('cex'), centre.col='black', labels=names(values), labels.cex=par('cex'), labels.col='black', labels.radius=radius-thickness/2, to.degrees=360, ...)
PlotDoughnut( values, clockwise=TRUE, origin.degrees=0, radius=1, thickness=0.5, frame.plot=FALSE, xlim=c(-radius, radius), ylim=c(-radius, radius), col=NULL, n=2500, centre.text=NULL, centre.cex=par('cex'), centre.col='black', labels=names(values), labels.cex=par('cex'), labels.col='black', labels.radius=radius-thickness/2, to.degrees=360, ...)
values |
values to be plotted. |
clockwise |
if |
origin.degrees |
clockwise number of degrees, starting at 12 o'clock, at which the first value is plotted. |
radius |
radius of the outside of the doughnut. |
thickness |
thickness of the doughnut. |
frame.plot |
if |
xlim |
the x limits of the plot. |
ylim |
the y limits of the plot. |
col |
colours of the segments. |
n |
number of points that make up the inside and outside of the circles. |
centre.text |
text to be plotted inside the doughnut. |
centre.cex |
character expansion factor of the centre text. |
centre.col |
colour of the centre text. |
labels |
labels to be plotted within each. |
labels.cex |
character expansion factor of the labels. |
labels.col |
colour of the labels. |
labels.radius |
radius at which labels will be plotted. |
to.degrees |
a value of 360 plots a complete doughnut; 180 plots half a doughnut. |
... |
other values to be passed to plotting functions. |
Plots ‘values’ in a doughnut. 'PlotDonut' is a synonym for 'PlotDoughnut'.
Lawrence Hudson
# Six presentations of the same data v <- c(25, 25, 12.5, 12.5, 25) names(v) <- LETTERS[1:length(v)] par(mfrow=c(2, 3), mar=c(0, 0, 0, 0), oma=c(0, 0, 5, 0)) PlotDoughnut(v, centre.text='Doughnut') PlotDoughnut(v, centre.text='Counter-clockwise', clockwise=FALSE) PlotDoughnut(v, centre.text=~Origin~at~90^o, origin.degrees=90) PlotDoughnut(v, centre.text='Half nut', to.degrees=180, origin=-90) PlotDoughnut(v, centre.text='Side nut', to.degrees=180, origin=0) PlotDoughnut(v, centre.text='Taken a bite', to.degrees=270, origin=-45, clockwise=FALSE, thickness=0.1) title(main='You doughnut', outer=TRUE, cex.main=3)
# Six presentations of the same data v <- c(25, 25, 12.5, 12.5, 25) names(v) <- LETTERS[1:length(v)] par(mfrow=c(2, 3), mar=c(0, 0, 0, 0), oma=c(0, 0, 5, 0)) PlotDoughnut(v, centre.text='Doughnut') PlotDoughnut(v, centre.text='Counter-clockwise', clockwise=FALSE) PlotDoughnut(v, centre.text=~Origin~at~90^o, origin.degrees=90) PlotDoughnut(v, centre.text='Half nut', to.degrees=180, origin=-90) PlotDoughnut(v, centre.text='Side nut', to.degrees=180, origin=0) PlotDoughnut(v, centre.text='Taken a bite', to.degrees=270, origin=-45, clockwise=FALSE, thickness=0.1) title(main='You doughnut', outer=TRUE, cex.main=3)