help bumpareabumparea v1.21 (GitHub)

bumparea

: A Stata package for bump area or ribbon plots.

Syntax

bumparea y x [if] [in], by(varname)
[ top(num) dropother smooth(num) palette(str) labcond(str) offset(num) alpha(num)
lcolor(str) lwidth(str) percent format(fmt) recenter(mid|top|bot) colorby(name) colorvar(var) colother(str)
xlabel(str) xtitle(str) ytitle(str) title(str) subtitle(str) note(str)
ysize(num) xsize(num) scheme(str) name(str) saving(str) ]

The options are described as follows:

bumparea y x, by(group) The command requires a numeric y variable and a numeric x variable. The x variable is usually a time variable.
The by() variable defines the groupings.

top(num) The number of rows to show in the graph. The default option is top(50). Non top() values are grouped in an "Others" category.

dropother Drop the "Others" category from the graph and just show the top() categories.

smooth(num) The smoothing parameter that ranges from 1-8. The default value is smooth(4). A value of 1 shows straight lines,
while a value of 8 shows almost vertical jumps.

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

colorby(name) Color by alphabetical values. This option is still beta and only takes only one argument. This option is highly useful when
making several bumparea plots for comparison to assign the same color to the same by() category. Otherwise, the color order is determined by the rank
order.

colorvar(var) Color by a predefined variable. Define a color variable that takes on values in increments of one. This is to fully control and customize the
colors assigned.

colother(var) Color of the other category. Default is colo(gs12)}.

alpha(num) The transparency of area fills. The default is alpha(80) for 80% transparency.

offset(num) Extends the x-axis range to accommodate labels. The default value is 15 for 15% of xmax-xmin.

recenter(options) This option changes where the graph is recentered. The default option is recenter(middle). Additional options are recenter(top)
or recenter(bottom). For brevity, the following can be specified: middle = mid = m, top = t, bottom = bot = b.

percent Shows the percentage share for the by() categories. Default is actual values.

format(fmt) Format the values of the by() categories. Default value is format(%12.0fc) for actual values and format(%5.2f) for the percent option.

lwidth(str) The line width of the area stroke. The default is lw(0.2).

lcolor(str) The line color of the area stroke. The default is lc(white).

labsize(str) Size of the by() category labels. Default value is labs(2.8).

xlabsize(str) Size of the x-axis labels. Default value is xlabs(2.5).

xlabangle(str) Angle of the x-axis labels. Default is xlaba(0) for zero degrees or horizontal orientation.

xtitle, ytitle, xsize, ysize These are standard twoway graph options.

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

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

Dependencies

The palette package (Jann 2018, 2022) is required:

ssc install palettes, replace
ssc install colrspace, replace

Even if you have these installed, it is highly recommended to check for updates: ado update, update

Examples

See GitHub.

Package details

Version : bumparea v1.21
This release : 15 Jan 2024
First release: 10 Apr 2023
Repository : GitHub
Keywords : Stata, graph, bump chart, ribbon 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.

Other visualization packages

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