-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert color palette docstrings to notebooks (#3034)
* Convert color palette docstrings to notebooks and rerun all with py310 kernel * Add v0.12.1 release notes to index * Improve failure mode when ipywidgets is not involved * Update palettes docstrings * Remove all other doctest-style examples * Remove doctest-oriented testing infrastructure * Mention in release notes * Skip colormap patch test on matplotlib's where it's not relevant * Use more robust approach to mpl backcompat
- Loading branch information
Showing
80 changed files
with
1,711 additions
and
593 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "8f97280e-cec8-42b2-a968-4fd4364594f8", | ||
"metadata": { | ||
"tags": [ | ||
"hide" | ||
] | ||
}, | ||
"outputs": [], | ||
"source": [ | ||
"import seaborn as sns\n", | ||
"sns.set_theme()\n", | ||
"sns.palettes._patch_colormap_display()" | ||
] | ||
}, | ||
{ | ||
"cell_type": "raw", | ||
"id": "972edede-df1a-4010-9674-00b864d020e2", | ||
"metadata": {}, | ||
"source": [ | ||
"Pass a list of two colors to interpolate between them:" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "e6ae2547-1042-4ac0-84ea-6f37a0229871", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"sns.blend_palette([\"b\", \"r\"])" | ||
] | ||
}, | ||
{ | ||
"cell_type": "raw", | ||
"id": "1d983eac-2dd5-4746-b27f-4dfa19b5e091", | ||
"metadata": {}, | ||
"source": [ | ||
"The color list can be arbitrarily long, and any color format can be used:" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "846b78fd-30ce-4507-93f4-4274122c1987", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"sns.blend_palette([\"#45a872\", \".8\", \"xkcd:golden\"])" | ||
] | ||
}, | ||
{ | ||
"cell_type": "raw", | ||
"id": "318fef32-1f83-44d9-9ff9-21fa0231b7c6", | ||
"metadata": {}, | ||
"source": [ | ||
"Return a continuous colormap instead of a discrete palette:" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "f0a05bc3-c60b-47a1-b276-d2e28a4a8226", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"sns.blend_palette([\"#bdc\", \"#7b9\", \"#47a\"], as_cmap=True)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "0473a402-0ec2-4877-81d2-ed6c57aefc77", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "py310", | ||
"language": "python", | ||
"name": "py310" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.10.0" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 5 | ||
} |
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.