Function to generate origami plot
origami_plot(
df,
pcol,
pfcol = NULL,
axistype = 0,
seg = 4,
pty = 16,
plty = 1:6,
plwd = 1,
pdensity = NULL,
pangle = 45,
cglty = 1.4,
cglwd = 0.1,
cglcol = "#000000",
axislabcol = "#808080",
title = "",
na.itp = TRUE,
centerzero = FALSE,
vlabels = NULL,
vlcex = 1,
caxislabels = seq(0, 1, by = 0.25),
calcex = NULL,
paxislabels = NULL,
palcex = NULL
)
No return value, called for visualization
dataset processed with data_preparation or in the designated form
color of the line of the polygon
color to fill the area of the polygon, default is NULL.
type of axes. 0:no axis label. 1:center axis label only. 2:around-the-chart label only. 3:both center and around-the-chart labels. Default is 0.
number of segments for each axis, default is 4.
point symbol, default is 16. 32 means not printing the points.
line types for plot data, default is 1:6
line widths for plot data, default is 1
filling density of polygons, default is NULL
angles of lines used as filling polygons, default is 45
line type for radar grids, default is 1.4
line width for radar grids, default is 0.1
line color for radar grids, default is #000000
color of axis label and numbers, default is #808080
title of the chart, default is blank
logical. If true, items with NA values are interpolated from nearest neighbor items and connect them. If false, items with NA are treated as the origin. Default is TRUE.
logical. If true, this function draws charts with scaling originated from (0,0). If false, charts originated from (1/segments). Default is TRUE.
character vector for the names for variables, default is NULL
font size magnification for vlabels, default is 1
center axis labels, default is seq(0,1,by = 0.25)
font size magnification for caxislabels, default is NULL
around-the-chart labels, default is NULL
font size magnification for paxislabels, default is NULL
This is the main function in the R package that takes a list of data frame(s) and constructs an origami plot. The function plots the main axes of the radar chart as solid lines and marks the score of each variable on these axes with a filled circle. Additionally, it plots auxiliary axes as dashed lines at equal distances between each neighboring pair of primary axes with auxiliary points generated from data_preparation. Finally, the function connects all the points in order and obtain a connected region that resembles an origami star. Through this method, we successfully address the challenge of axis order affecting the area of the connected region in radar plots. The plot generated using ‘origami_plot’ benefit in that the area of the connected region within the origami plot remains consistent regardless of axis sequence.
data(sucra)
df_list <- data_preparation(sucra, min_value = 0.15)
origami_plot(df=df_list[[1]], pcol = rgb(0.2,0.5,0.5,1),
pfcol = rgb(0.2,0.5,0.5,0.1),axistype=1, pty = 32)
Run the code above in your browser using DataLab