andrews_curves(frame, class_column, ax=None, samples=200, color=None, colormap=None, **kwargs)
Andrews curves have the functional form:
f(t) = x_1/sqrt(2) + x_2 sin(t) + x_3 cos(t) +
x_4 sin(2t) + x_5 cos(2t) + ...
Where x coefficients correspond to the values of each dimension and t is linearly spaced between -pi and +pi. Each row of frame then corresponds to a single curve.
Data to be plotted, preferably normalized to (0.0, 1.0).
Colors to use for the different classes.
Colormap to select colors from. If string, load colormap with that name from matplotlib.
Options to pass to matplotlib plotting method.
Generate a matplotlib plot of Andrews curves, for visualising clusters of multivariate data.
.. plot:: ('context', 'close-figs')
See :>>> df = pd.read_csv( ... 'https://raw.github.com/pandas-dev/' ... 'pandas/main/pandas/tests/io/data/csv/iris.csv' ... ) >>> pd.plotting.andrews_curves(df, 'Name') <AxesSubplot:title={'center':'width'}>
Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.
Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)
SVG is more flexible but power hungry; and does not scale well to 50 + nodes.
All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them