help arcplotarcplot v1.3 (GitHub)

arcplot

: A Stata package for Arc plots.

The command is based on the Arc plots guide on Medium.

Syntax

arcplot var [if] [in], from(var) to(var)
[ gap(num) arcpoints(num) palette(str) alpha(num) format(str) lcolor(str) lwidth(num)
sort(value|name) boxwidth(str) boxintensity(num) offset(num)
labgap(str) labangle(str) labsize(num) labcolor(str) labpos(str)
valgap(str) valangle(str) valsize(num) valcolor(str) valpos(str) valcondition(num)
aspect(num) xsize(num) ysize(num) title(str) subtitle(str) note(str) scheme(str) name(str)
]

arcplot var The command requires a numeric var variable.

from(var) to(var) These are the source and destination variables.

gap(num) Gap between the horizontal bars. Default value is gap(2) or 2% of total width.

alpha(num) Transparency of the arcs. The default value is alpha(50) for 50%.

sort(value|name) Sort order of the boxes. Default is which results in numerically sorted boxes and arcs.
The option will be alphabetically organized.

boxwidth(num) Thickness of the boxes. Default is boxw(1.6).

boxintensity(num) Color intensity of the box indicating outgoing flows. Default is boxint(0.7).
A value of 1 will result in same inflow and outflow colors.

palette(str) Color name is any named scheme defined in the colorpalette package. Default is tableau.

lcolor(str) The outline color of the area fill. Default is lc(black).

lwidth(num) The outline width of the area fill. Default is lw(none). Therefore by default the arcs will have no outlines.

arcpoints(num) Number of arc points. Higher values will result in smoother arcs. Default value is arcp(100).

labsize(str) The size of the category labels. The default value is labs(2).

labcolor(str) The color of the category labels. The default value is labc(black).

labangle(str) The angle of the category labels. The default value is laba(0) for horizontal.

labgap(str) The gap of the category labels. The default value is labg(0.5).

labpos(str) The position of the category labels. The default value is labpos(6).

offset(num) Offset for the y-axis. Default is offset(0) or 0% of graph height.
Highly useful if labels are rotated and a gap at the bottom is required to fully display them.

format(str) The format of the value labels. Default is format(%15.0fc).

valcondition(num) The condition to label the values is >= num. The default value is valcond(0).

valsize(str) The size of the value labels. The default value is vals(1.2).

valcolor(str) The color of the value labels. The default value is valc(black).

valangle(str) The angle of the value labels. The default value is vala(90) for 90 degrees.

valgap(str) The gap of the value labels from the horizontal bars. The default value is valg(2).

valpos(str) The position of the category labels. The default value is valpos(12).

aspect(num) Aspect ratio of the graph. The default is set at aspect(0.5) to maintain the 2:1 graph ratio
with default values. If gaps are added, this might need adjustment.

title, subtitle, note These are standard twoway graph options.

xsize(), ysize() These are standard twoway graph options for changing the dimensions of the graphs.

scheme(string) Load the custom scheme. Above options can be used to fine tune individual elements.

name(string) Assign a name to the graph.

Dependencies

arcplot requires palettes package (Jann 2018, 2022):

ssc install palettes, replace
ssc install colrspace, replace

and gtools package to faster reshaping:

ssc install gtools, replace

Examples

Check GitHub for examples.

Package details

Version : arcplot v1.3
This release : 31 Mar 2024
First release: 22 Jun 2022
Repository : GitHub
Keywords : Stata, graph, arc plot
License : MIT

Author : Asjad Naqvi
E-mail : asjadnaqvi@gmail.com
Twitter : @AsjadNaqvi

Feedback

Please submit bugs, errors, feature requests on GitHub by opening a new issue.

References

Jann, B. (2018). Color palettes for Stata graphics. The Stata Journal 18(4): 765-785.

Jann, B. (2022). Color palettes for Stata graphics: an update. University of Bern Social Sciences Working Papers No. 43.

Caceres, M. (2022). Gtools website.

Other visualization packages

arcplot, alluvial, bimap, bumparea, bumpline, circlebar, circlepack, clipgeo, delaunay, joyplot,
marimekko, sankey, schemepack, spider, streamplot, sunburst, treecluster, treemap