Function Repository Resource:

AndrewsPlot

Source Notebook

Visualize multivariate data by projecting them on a Fourier basis

Contributed by: Giulio Alessandrini

ResourceFunction["AndrewsPlot"][data]

plots a two-dimensional projection of data on a Fourier basis.

Details and Options

AndrewsPlot supports all the options of Plot with the following additions and modifications:
MaxItems50maximum number of example to show
PerformanceGoal"Speed"aspects of performance to try to optimize
PlotLegendsAutomaticlegends for datasets

Examples

Basic Examples (1) 

Plot a random ten-dimensional dataset:

In[1]:=
ResourceFunction["AndrewsPlot"][RandomReal[1, {100, 10}]]
Out[1]=

Properties and Relations (1) 

The number of curves and general curviness is controlled by the dataset dimensions:

In[2]:=
Grid[Table[
  ResourceFunction["AndrewsPlot"][RandomReal[1, {d, k}], ImageSize -> 200], {k, 3, 5}, {d, 10, 30, 10}]]
Out[2]=

Scope (3) 

Plot a high-dimensional dataset:

In[3]:=
ResourceFunction["AndrewsPlot"][RandomReal[1, {50, 5}]]
Out[3]=

Plot multiple datasets:

In[4]:=
ResourceFunction[
 "AndrewsPlot"][{2 RandomReal[1, {60, 5}], RandomReal[1, {30, 8}]}]
Out[4]=

Specify datasets using an association:

In[5]:=
ResourceFunction[
 "AndrewsPlot"][<|"dataset_1" -> 2 RandomReal[1, {100, 5}], "dataset_2" -> RandomReal[1, {50, 8}]|>]
Out[5]=

Applications (2) 

Visualize the famous Fisher's Irises dataset:

In[6]:=
ResourceFunction["AndrewsPlot"][
 GroupBy[ResourceData["Sample Data: Fisher's Irises", "TrainingData"],
   Last -> First]]
Out[6]=

Visualize the features of wine bottles at three different quality score:

In[7]:=
ResourceFunction["AndrewsPlot"][
 KeyTake[GroupBy[
   ResourceData["Sample Data: Wine Quality", "TrainingData"], Last -> First], {3., 7., 9.}]]
Out[7]=

Version History

  • 1.0.0 – 01 May 2023

Related Resources

License Information