plot_pieplot: Plot pie

View source: R/graphics.R

plot_pieplotR Documentation

Plot pie

Description

Pie chart from a two‑column data.frame (category, value) using polar coordinates.

Usage

plot_pieplot(
  data,
  label_x = "",
  label_y = "",
  colors = NULL,
  textcolor = "white",
  bordercolor = "black"
)

Arguments

data

two‑column data.frame with category and value

label_x

x‑axis label (unused in pie, kept for symmetry)

label_y

y‑axis label (unused in pie)

colors

vector of slice fills

textcolor

label text color

bordercolor

slice border color

Details

Slices are sized by the second (numeric) column. Text and border colors can be customized.

Value

returns a ggplot2::ggplot graphic

Examples

#summarizing iris dataset
data <- iris |> dplyr::group_by(Species) |>
dplyr::summarize(Sepal.Length=mean(Sepal.Length))
head(data)

#ploting data
grf <- plot_pieplot(data, colors=c("red", "green", "blue"))
plot(grf)

daltoolbox documentation built on Nov. 5, 2025, 7:09 p.m.