Skip to main content

No project description provided

Project description

splineplot

A tiny Python package for plotting splines

splineplot is a tiny Python package that uses statsmodels to fit a spline to 1-dimensional data and plot it, along with a scatter plot. It can be used on its own, or in conjunction with Seaborn; its interface is similar to that of regplot.

import seaborn as sns

iris = sns.load_dataset("iris")

g = sns.FacetGrid(
    iris,
    hue="species",
    aspect=1.3,
    height=4,
)

g.map(
    splineplot,
    "sepal_length",
    "sepal_width",
    alpha=0,
    scatter_kws={"s": 3},
)
_ = g.add_legend()

The resulting chart from the above code

A Note On alpha

The alpha argument to splineplot determines the smoothing penalty used when the spline is fit to the y data. It's important to consider overfitting when setting this value; in general a value of 0 with modest dataset sizes is almost guaranteed to overfit.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

splineplot-0.3.1.tar.gz (6.0 kB view hashes)

Uploaded Source

Built Distribution

splineplot-0.3.1-py3-none-any.whl (6.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page