Repository navigation
docs: Add an Andrews curves example to the gallery - #4049
Merged
Merged
Conversation
mattijn
previously requested changes
Jun 5, 2026
mattijn
left a comment
Contributor
There was a problem hiding this comment.
Thanks for the PR and nice looking example! I have some minor inline suggestions. We prefer None over "" in empty titles, and we have a preference to square default examples (see marimo-team/marimo#8596 for a recent reasoning for this).
(btw looking forward to have this feature in VL upstream to eventually build some interaction with these type of plots.)
Again thanks for the PR!
Contributor
Author
|
Thanks @mattijn! Applied both suggestions in the arguments- and methods-syntax files: used |
mattijn
enabled auto-merge (squash)
June 6, 2026 09:59
Contributor
|
Thanks! looks good |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2470.
Description
Adds an Andrews Curves example to the example gallery, as requested in #2470 (labelled documentation / good first issue).
Andrews curves visualize clusters in multivariate data by mapping each observation to a finite Fourier series and drawing it as a single line, so observations in the same group trace out similar shapes. The example uses the
penguinsdataset fromaltair.datasetsand colours each curve by species.As described in the contributing guide, the example is added in both syntaxes, under the Advanced Calculations category:
tests/examples_arguments_syntax/andrews_curves.pytests/examples_methods_syntax/andrews_curves.pyA few implementation notes:
f(t) = x1/√2 + x2·sin(t) + x3·cos(t) + x4·sin(2t), with each dimension normalized to(0, 1)so no single column dominates.max_rowslimit, an even sample of 15 rows per species is taken (3 × 15 observations × 100 samples = 4500 rows), which keeps all three species clearly represented.Tests & Docs
The example is itself a documentation/gallery item and is covered by the existing
tests/test_examples.pysuite. I verified locally (altair 6.1.0) that, for both files, the harness flow passes:eval_blockreturns aChart;chart.to_dict()succeeds;to_json→from_json→to_jsonround-trip is stable;max_rows=5000).I did not run the full Sphinx docs/image build locally, so the rendered thumbnail has not been generated on my machine.