help splinefitsplinefit v1.1 (GitHub)

splinefit

: A Stata package for smooth connected line plots.

The routine is based on the Catmull-Rom spline function.

Syntax

splinefit y x [if] [in],
[ smooth(0-1) close points(num) lwidth(str) lcolor(str) lpattern(str) msymbol(str) msize(str)
mcolor(str) mlabel(str) mlabposition(str) mlabsize(str) * ]

splinefit y x y and x are scatter point variables. Please make sure they are correctly sorted.

smooth(num) A smoothing fit variable between 0 and 1. A smaller value will result in larger and rounder fits. A high value will have tighter bends
but if the points are bunched together, then this might also create undesireable loops. Default is smooth(0.5).

close Close the loop between the first and the last point.

points(num) Number of points to evaluate the curve between two points. Higher points will result in more accuracy but will be slower.
Default is . Ideally don't touch this.

lwidth(str) The line width.

lcolor(str) The line color.

lpattern(str) The line pattern.

msymbol(str) The marker symbol.

mcolor(str) The marker color.

msize(str) The marker size.

mlwidth(str) The marker outline width.

mlabel(str) The marker label.

mlabcolor(str) The marker label color.

mlabsize(str) The marker label size.

mlabposition(str) The marker label position.

* All other standard twoway options.

Examples

See GitHub for examples.

Package details

Version : splinefit v1.1
This release : 02 May 2024
First release: 01 Aug 2023
Repository : GitHub
Keywords : Stata, graph, spline fit, smooth fit
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.

Other visualization packages

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