Generate a matplotlib plot for visualizing clusters of multivariate data.
Andrews curves have the functional form:
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).
Name of the column containing class names.
Axes to use.
Number of points to plot in each curve.
Colors to use for the different classes. Colors can be strings or 3-element floating point RGB values.
Colormap to select colors from. If a string, load colormap with that name from matplotlib.
Options to pass to matplotlib plotting method.
Examples
>>> df = pd.read_csv(
... 'https://raw.githubusercontent.com/pandas-dev/'
... 'pandas/main/pandas/tests/io/data/csv/iris.csv'
... )
>>> pd.plotting.andrews_curves(df, 'Name')
© 2008–2011, AQR Capital Management, LLC, Lambda Foundry, Inc. and PyData Development Team
© 2011–2025, Open source contributors
Licensed under the 3-clause BSD License.
https://pandas.pydata.org/pandas-docs/version/2.3.0/reference/api/pandas.plotting.andrews_curves.html