-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7486e32
commit 2d93500
Showing
43 changed files
with
1,400 additions
and
615 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"TabSet1": 0, | ||
"TabSet1": 4, | ||
"TabSet2": 4, | ||
"TabZoom": {} | ||
} |
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"source_window_id": "", | ||
"Source": "Source", | ||
"cursorPosition": "33,0", | ||
"scrollLine": "26" | ||
"cursorPosition": "67,79", | ||
"scrollLine": "55" | ||
} |
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 |
---|---|---|
@@ -1 +1 @@ | ||
{"chunk_definitions":[],"doc_write_time":1739101456} | ||
{"chunk_definitions":[],"doc_write_time":1739263361} |
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
1 change: 1 addition & 0 deletions
1
code/matplotlib/.jupyter/desktop-workspaces/default-37a8.jupyterlab-workspace
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 @@ | ||
{"data":{"layout-restorer:data":{"main":{"dock":{"type":"tab-area","currentIndex":1,"widgets":["notebook:reproduce/Untitled.ipynb"]},"current":"notebook:reproduce/Untitled.ipynb"},"down":{"size":0,"widgets":[]},"left":{"collapsed":false,"visible":true,"current":"filebrowser","widgets":["filebrowser","running-sessions","@jupyterlab/toc:plugin","extensionmanager.main-view"]},"right":{"collapsed":true,"visible":true,"widgets":["jp-property-inspector","debugger-sidebar"]},"relativeSizes":[0.16621694549379384,0.8337830545062062,0],"top":{"simpleVisibility":true}},"file-browser-filebrowser:cwd":{"path":"reproduce"},"notebook:reproduce/unemployment.ipynb":{"data":{"path":"reproduce/unemployment.ipynb","factory":"Notebook"}}},"metadata":{"id":"default"}} |
135 changes: 135 additions & 0 deletions
135
code/matplotlib/gallery_jupyter/statistics/.ipynb_checkpoints/bxp-checkpoint.ipynb
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,135 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"\n", | ||
"# Separate calculation and plotting of boxplots\n", | ||
"\n", | ||
"Drawing a `~.axes.Axes.boxplot` for a given data set, consists of two main operations,\n", | ||
"that can also be used separately:\n", | ||
"\n", | ||
"1. Calculating the boxplot statistics: `matplotlib.cbook.boxplot_stats`\n", | ||
"2. Drawing the boxplot: `matplotlib.axes.Axes.bxp`\n", | ||
"\n", | ||
"Thus, ``ax.boxplot(data)`` is equivalent to ::\n", | ||
"\n", | ||
" stats = cbook.boxplot_stats(data)\n", | ||
" ax.bxp(stats)\n", | ||
"\n", | ||
"All styling keyword arguments are identical between `~.axes.Axes.boxplot` and\n", | ||
"`~.axes.Axes.bxp`, and they are passed through from `~.axes.Axes.boxplot` to\n", | ||
"`~.axes.Axes.bxp`. However, the *tick_labels* parameter of `~.axes.Axes.boxplot`\n", | ||
"translates to a generic *labels* parameter in `.boxplot_stats`, because the labels are\n", | ||
"data-related and attached to the returned per-dataset dictionaries.\n", | ||
"\n", | ||
"The following code demonstrates the equivalence between the two methods.\n" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": { | ||
"collapsed": false, | ||
"jupyter": { | ||
"outputs_hidden": false | ||
} | ||
}, | ||
"outputs": [], | ||
"source": [ | ||
"import matplotlib.pyplot as plt\n", | ||
"import numpy as np\n", | ||
"\n", | ||
"from matplotlib import cbook\n", | ||
"\n", | ||
"np.random.seed(19680801)\n", | ||
"data = np.random.randn(20, 3)\n", | ||
"\n", | ||
"fig, (ax1, ax2) = plt.subplots(1, 2)\n", | ||
"\n", | ||
"# single boxplot call\n", | ||
"ax1.boxplot(data, tick_labels=['A', 'B', 'C'],\n", | ||
" patch_artist=True, boxprops={'facecolor': 'bisque'})\n", | ||
"\n", | ||
"# separate calculation of statistics and plotting\n", | ||
"stats = cbook.boxplot_stats(data, labels=['A', 'B', 'C'])\n", | ||
"ax2.bxp(stats, patch_artist=True, boxprops={'facecolor': 'bisque'})" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"Using the separate functions allows to pre-calculate statistics, in case you need\n", | ||
"them explicitly for other purposes, or to reuse the statistics for multiple plots.\n", | ||
"\n", | ||
"Conversely, you can also use the `~.axes.Axes.bxp` function directly, if you already\n", | ||
"have the statistical parameters:\n", | ||
"\n" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": { | ||
"collapsed": false, | ||
"jupyter": { | ||
"outputs_hidden": false | ||
} | ||
}, | ||
"outputs": [], | ||
"source": [ | ||
"fig, ax = plt.subplots()\n", | ||
"\n", | ||
"stats = [\n", | ||
" dict(med=0, q1=-1, q3=1, whislo=-2, whishi=2, fliers=[-4, -3, 3, 4], label='A'),\n", | ||
" dict(med=0, q1=-2, q3=2, whislo=-3, whishi=3, fliers=[], label='B'),\n", | ||
" dict(med=0, q1=-3, q3=3, whislo=-4, whishi=4, fliers=[], label='C'),\n", | ||
"]\n", | ||
"\n", | ||
"ax.bxp(stats, patch_artist=True, boxprops={'facecolor': 'bisque'})\n", | ||
"\n", | ||
"plt.show()" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
".. tags:: plot-type: speciality, domain: statistics\n", | ||
"\n", | ||
".. admonition:: References\n", | ||
"\n", | ||
" The use of the following functions, methods, classes and modules is shown\n", | ||
" in this example:\n", | ||
"\n", | ||
" - `matplotlib.axes.Axes.bxp`\n", | ||
" - `matplotlib.axes.Axes.boxplot`\n", | ||
" - `matplotlib.cbook.boxplot_stats`\n", | ||
"\n" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3 (ipykernel)", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"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.8.18" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 4 | ||
} |
Oops, something went wrong.