Skip to content

Commit f1852f3

Browse files
committed
🔖 Publish docs for matplotlib v3.8.1 and scikit-learn v1.3.2.
1 parent 17edeb8 commit f1852f3

18,467 files changed

Lines changed: 3156029 additions & 1965781 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ No need to clone the huge PyTorch repo. No need to install Sphinx. No need to wa
1313
| Docs | Version | Release Page |
1414
| ------------ | ------------------------------------------------------------ | ------------------------------------------------------------ |
1515
| PyTorch | [![torch version](https://img.shields.io/badge/torch_version-v2.1.0-282828.svg?labelColor=4F4F4F&logo=PyTorch)](https://pytorch.org/blog/pytorch-2-1/) | [Link](https://github.com/unknownue/PyTorch.docs/releases/tag/v2.1.0) |
16-
| torchvision | [![torchvision version](https://img.shields.io/badge/torchvision_version-v0.16.0-282828.svg?labelColor=4F4F4FF&logo=PyTorch)](https://github.com/pytorch/vision/releases/tag/v0.16.0) | [Link](https://github.com/unknownue/PyTorch.docs/releases/tag/v1.11.0) |
17-
| Numpy | [![numpy version](https://badgen.net/badge/NumPy%20version/v1.26.0/black?icon=dockbit)](https://numpy.org/doc/1.26/release.html) | [Link](https://numpy.org/doc/1.26/numpy-html.zip) |
18-
| Scikit-learn | [![scikit-learn version](https://badgen.net/badge/Scikit-learn%20version/v0.22/black?icon=libraries)](https://github.com/scikit-learn/scikit-learn/releases/tag/0.23.2) | [Link](https://github.com/unknownue/PyTorch.docs/releases/tag/v1.7.1) |
19-
| Matplotlib | [![matplotlib version](https://badgen.net/badge/Matplotlib%20version/v3.3.1/black?icon=graphql)](https://github.com/matplotlib/matplotlib/releases/tag/v3.3.1) | [Link](https://github.com/unknownue/PyTorch.docs/releases/tag/v1.6.1) |
16+
| torchvision | [![torchvision version](https://img.shields.io/badge/torchvision_version-v0.16.0-282828.svg?labelColor=4F4F4FF&logo=PyTorch)](https://github.com/pytorch/vision/releases/tag/v0.16.0) | [Link](https://github.com/unknownue/PyTorch.docs/releases/tag/v2.1.0) |
17+
| Numpy | [![numpy version](https://badgen.net/badge/NumPy%20version/v1.26.0/black?icon=dockbit)](https://numpy.org/doc/1.26/release.html) | [Link](https://numpy.org/doc/1.26/numpy-html.zip) |
18+
| Scikit-learn | [![scikit-learn version](https://badgen.net/badge/Scikit-learn%20version/v1.3.2/black?icon=libraries)](https://github.com/scikit-learn/scikit-learn/releases/tag/1.3.2) | [Link](https://github.com/unknownue/PyTorch.docs/releases/tag/v2.1.1) |
19+
| Matplotlib | [![matplotlib version](https://badgen.net/badge/Matplotlib%20version/v3.8.1/black?icon=graphql)](https://github.com/matplotlib/matplotlib/releases/tag/v3.8.1) | [Link](https://github.com/unknownue/PyTorch.docs/releases/tag/v2.1.1) |
2020

2121
## How to use
2222

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Sphinx build info version 1
22
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
3-
config: 3fd472b8eebc56647ac771f4a7bc3924
3+
config: d417b87a3fb2855ee1fc75d9ca941351
44
tags: 645f666f9bcd5a90fca523b33c5a78b7
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"metadata": {},
6+
"source": [
7+
"\n# Plotting multiple lines with a LineCollection\n\nMatplotlib can efficiently draw multiple lines at once using a\n`~.LineCollection`, as showcased below.\n"
8+
]
9+
},
10+
{
11+
"cell_type": "code",
12+
"execution_count": null,
13+
"metadata": {
14+
"collapsed": false
15+
},
16+
"outputs": [],
17+
"source": [
18+
"import matplotlib.pyplot as plt\nimport numpy as np\n\nfrom matplotlib.collections import LineCollection\n\nx = np.arange(100)\n# Here are many sets of y to plot vs. x\nys = x[:50, np.newaxis] + x[np.newaxis, :]\n\nsegs = np.zeros((50, 100, 2))\nsegs[:, :, 1] = ys\nsegs[:, :, 0] = x\n\n# Mask some values to test masked array support:\nsegs = np.ma.masked_where((segs > 50) & (segs < 60), segs)\n\n# We need to set the plot limits, they will not autoscale\nfig, ax = plt.subplots()\nax.set_xlim(x.min(), x.max())\nax.set_ylim(ys.min(), ys.max())\n\n# *colors* is sequence of rgba tuples.\n# *linestyle* is a string or dash tuple. Legal string values are\n# solid|dashed|dashdot|dotted. The dash tuple is (offset, onoffseq) where\n# onoffseq is an even length tuple of on and off ink in points. If linestyle\n# is omitted, 'solid' is used.\n# See `matplotlib.collections.LineCollection` for more information.\ncolors = plt.rcParams['axes.prop_cycle'].by_key()['color']\n\nline_segments = LineCollection(segs, linewidths=(0.5, 1, 1.5, 2),\n colors=colors, linestyle='solid')\nax.add_collection(line_segments)\nax.set_title('Line collection with masked arrays')\nplt.show()"
19+
]
20+
},
21+
{
22+
"cell_type": "markdown",
23+
"metadata": {},
24+
"source": [
25+
"In the following example, instead of passing a list of colors\n(``colors=colors``), we pass an array of values (``array=x``) that get\ncolormapped.\n\n"
26+
]
27+
},
28+
{
29+
"cell_type": "code",
30+
"execution_count": null,
31+
"metadata": {
32+
"collapsed": false
33+
},
34+
"outputs": [],
35+
"source": [
36+
"N = 50\nx = np.arange(N)\nys = [x + i for i in x] # Many sets of y to plot vs. x\nsegs = [np.column_stack([x, y]) for y in ys]\n\nfig, ax = plt.subplots()\nax.set_xlim(np.min(x), np.max(x))\nax.set_ylim(np.min(ys), np.max(ys))\n\nline_segments = LineCollection(segs, array=x,\n linewidths=(0.5, 1, 1.5, 2),\n linestyles='solid')\nax.add_collection(line_segments)\naxcb = fig.colorbar(line_segments)\naxcb.set_label('Line Number')\nax.set_title('Line Collection with mapped colors')\nplt.sci(line_segments) # This allows interactive changing of the colormap.\nplt.show()"
37+
]
38+
},
39+
{
40+
"cell_type": "markdown",
41+
"metadata": {},
42+
"source": [
43+
".. admonition:: References\n\n The use of the following functions, methods, classes and modules is shown\n in this example:\n\n - `matplotlib.collections`\n - `matplotlib.collections.LineCollection`\n - `matplotlib.cm.ScalarMappable.set_array`\n - `matplotlib.axes.Axes.add_collection`\n - `matplotlib.figure.Figure.colorbar` / `matplotlib.pyplot.colorbar`\n - `matplotlib.pyplot.sci`\n\n"
44+
]
45+
}
46+
],
47+
"metadata": {
48+
"kernelspec": {
49+
"display_name": "Python 3",
50+
"language": "python",
51+
"name": "python3"
52+
},
53+
"language_info": {
54+
"codemirror_mode": {
55+
"name": "ipython",
56+
"version": 3
57+
},
58+
"file_extension": ".py",
59+
"mimetype": "text/x-python",
60+
"name": "python",
61+
"nbconvert_exporter": "python",
62+
"pygments_lexer": "ipython3",
63+
"version": "3.11.0"
64+
}
65+
},
66+
"nbformat": 4,
67+
"nbformat_minor": 0
68+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
"""
2+
==============
3+
stairs(values)
4+
==============
5+
6+
See `~matplotlib.axes.Axes.stairs`.
7+
"""
8+
import matplotlib.pyplot as plt
9+
import numpy as np
10+
11+
plt.style.use('_mpl-gallery')
12+
13+
# make data
14+
y = [4.8, 5.5, 3.5, 4.6, 6.5, 6.6, 2.6, 3.0]
15+
16+
# plot
17+
fig, ax = plt.subplots()
18+
19+
ax.stairs(y, linewidth=2.5)
20+
21+
ax.set(xlim=(0, 8), xticks=np.arange(1, 8),
22+
ylim=(0, 8), yticks=np.arange(1, 8))
23+
24+
plt.show()
56 KB
Loading
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
x = np.linspace(1., 3., 10)
2+
y = x**3
3+
4+
fig, ax = plt.subplots()
5+
ax.plot(x, y, linestyle='--', color='orange', gapcolor='blue',
6+
linewidth=3, label='a striped line')
7+
ax.legend()
9.53 KB
Loading
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
"""
2+
==========
3+
Hyperlinks
4+
==========
5+
6+
This example demonstrates how to set a hyperlinks on various kinds of elements.
7+
8+
This currently only works with the SVG backend.
9+
10+
"""
11+
12+
13+
import matplotlib.pyplot as plt
14+
import numpy as np
15+
16+
import matplotlib.cm as cm
17+
18+
# %%
19+
20+
fig = plt.figure()
21+
s = plt.scatter([1, 2, 3], [4, 5, 6])
22+
s.set_urls(['https://www.bbc.com/news', 'https://www.google.com/', None])
23+
fig.savefig('scatter.svg')
24+
25+
# %%
26+
27+
fig = plt.figure()
28+
delta = 0.025
29+
x = y = np.arange(-3.0, 3.0, delta)
30+
X, Y = np.meshgrid(x, y)
31+
Z1 = np.exp(-X**2 - Y**2)
32+
Z2 = np.exp(-(X - 1)**2 - (Y - 1)**2)
33+
Z = (Z1 - Z2) * 2
34+
35+
im = plt.imshow(Z, interpolation='bilinear', cmap=cm.gray,
36+
origin='lower', extent=(-3, 3, -3, 3))
37+
38+
im.set_url('https://www.google.com/')
39+
fig.savefig('image.svg')
126 KB
Loading

matplotlib/_downloads/00f7f20b47c4afdb8cf00a246bc6af53/animation_demo.py renamed to mathplotlib/_downloads/00f7f20b47c4afdb8cf00a246bc6af53/animation_demo.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
examples that use it.
1111
1212
Note that calling `time.sleep` instead of `~.pyplot.pause` would *not* work.
13+
14+
Output generated via `matplotlib.animation.Animation.to_jshtml`.
1315
"""
1416

1517
import matplotlib.pyplot as plt
@@ -20,9 +22,9 @@
2022

2123
fig, ax = plt.subplots()
2224

23-
for i in range(len(data)):
24-
ax.cla()
25-
ax.imshow(data[i])
26-
ax.set_title("frame {}".format(i))
25+
for i, img in enumerate(data):
26+
ax.clear()
27+
ax.imshow(img)
28+
ax.set_title(f"frame {i}")
2729
# Note that using time.sleep does *not* work here!
2830
plt.pause(0.1)

0 commit comments

Comments
 (0)