Skip to content

Commit 9a85edb

Browse files
committed
move 3.0.0 docs to top level
1 parent e8857df commit 9a85edb

6,299 files changed

Lines changed: 207299 additions & 66797 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.

Matplotlib.pdf

2.75 MB
Binary file not shown.
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": null,
6+
"metadata": {
7+
"collapsed": false
8+
},
9+
"outputs": [],
10+
"source": [
11+
"%matplotlib inline"
12+
]
13+
},
14+
{
15+
"cell_type": "markdown",
16+
"metadata": {},
17+
"source": [
18+
"\n# Scatter Star Poly\n\n\nCreate multiple scatter plots with different\nstar symbols.\n\n\n"
19+
]
20+
},
21+
{
22+
"cell_type": "code",
23+
"execution_count": null,
24+
"metadata": {
25+
"collapsed": false
26+
},
27+
"outputs": [],
28+
"source": [
29+
"import numpy as np\nimport matplotlib.pyplot as plt\n\n# Fixing random state for reproducibility\nnp.random.seed(19680801)\n\n\nx = np.random.rand(10)\ny = np.random.rand(10)\nz = np.sqrt(x**2 + y**2)\n\nplt.subplot(321)\nplt.scatter(x, y, s=80, c=z, marker=\">\")\n\nplt.subplot(322)\nplt.scatter(x, y, s=80, c=z, marker=(5, 0))\n\nverts = np.array([[-1, -1], [1, -1], [1, 1], [-1, -1]])\nplt.subplot(323)\nplt.scatter(x, y, s=80, c=z, marker=verts)\n\nplt.subplot(324)\nplt.scatter(x, y, s=80, c=z, marker=(5, 1))\n\nplt.subplot(325)\nplt.scatter(x, y, s=80, c=z, marker='+')\n\nplt.subplot(326)\nplt.scatter(x, y, s=80, c=z, marker=(5, 2))\n\nplt.show()"
30+
]
31+
}
32+
],
33+
"metadata": {
34+
"kernelspec": {
35+
"display_name": "Python 3",
36+
"language": "python",
37+
"name": "python3"
38+
},
39+
"language_info": {
40+
"codemirror_mode": {
41+
"name": "ipython",
42+
"version": 3
43+
},
44+
"file_extension": ".py",
45+
"mimetype": "text/x-python",
46+
"name": "python",
47+
"nbconvert_exporter": "python",
48+
"pygments_lexer": "ipython3",
49+
"version": "3.7.0"
50+
}
51+
},
52+
"nbformat": 4,
53+
"nbformat_minor": 0
54+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
"""
2+
=======================================
3+
Different ways of specifying error bars
4+
=======================================
5+
6+
Errors can be specified as a constant value (as shown in
7+
`errorbar_demo.py`). However, this example demonstrates
8+
how they vary by specifying arrays of error values.
9+
10+
If the raw ``x`` and ``y`` data have length N, there are two options:
11+
12+
Array of shape (N,):
13+
Error varies for each point, but the error values are
14+
symmetric (i.e. the lower and upper values are equal).
15+
16+
Array of shape (2, N):
17+
Error varies for each point, and the lower and upper limits
18+
(in that order) are different (asymmetric case)
19+
20+
In addition, this example demonstrates how to use log
21+
scale with error bars.
22+
"""
23+
24+
import numpy as np
25+
import matplotlib.pyplot as plt
26+
27+
# example data
28+
x = np.arange(0.1, 4, 0.5)
29+
y = np.exp(-x)
30+
31+
# example error bar values that vary with x-position
32+
error = 0.1 + 0.2 * x
33+
34+
fig, (ax0, ax1) = plt.subplots(nrows=2, sharex=True)
35+
ax0.errorbar(x, y, yerr=error, fmt='-o')
36+
ax0.set_title('variable, symmetric error')
37+
38+
# error bar values w/ different -/+ errors that
39+
# also vary with the x-position
40+
lower_error = 0.4 * error
41+
upper_error = error
42+
asymmetric_error = [lower_error, upper_error]
43+
44+
ax1.errorbar(x, y, xerr=asymmetric_error, fmt='o')
45+
ax1.set_title('variable, asymmetric error')
46+
ax1.set_yscale('log')
47+
plt.show()
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": null,
6+
"metadata": {
7+
"collapsed": false
8+
},
9+
"outputs": [],
10+
"source": [
11+
"%matplotlib inline"
12+
]
13+
},
14+
{
15+
"cell_type": "markdown",
16+
"metadata": {},
17+
"source": [
18+
"\n# Agg Buffer\n\n\nUse backend agg to access the figure canvas as an RGB string and then\nconvert it to an array and pass it to Pillow for rendering.\n\n"
19+
]
20+
},
21+
{
22+
"cell_type": "code",
23+
"execution_count": null,
24+
"metadata": {
25+
"collapsed": false
26+
},
27+
"outputs": [],
28+
"source": [
29+
"import numpy as np\n\nfrom matplotlib.backends.backend_agg import FigureCanvasAgg\nimport matplotlib.pyplot as plt\n\nplt.plot([1, 2, 3])\n\ncanvas = plt.get_current_fig_manager().canvas\n\nagg = canvas.switch_backends(FigureCanvasAgg)\nagg.draw()\ns, (width, height) = agg.print_to_buffer()\n\n# Convert to a NumPy array.\nX = np.fromstring(s, np.uint8).reshape((height, width, 4))\n\n# Pass off to PIL.\nfrom PIL import Image\nim = Image.frombytes(\"RGBA\", (width, height), s)\n\n# Uncomment this line to display the image using ImageMagick's `display` tool.\n# im.show()"
30+
]
31+
}
32+
],
33+
"metadata": {
34+
"kernelspec": {
35+
"display_name": "Python 3",
36+
"language": "python",
37+
"name": "python3"
38+
},
39+
"language_info": {
40+
"codemirror_mode": {
41+
"name": "ipython",
42+
"version": 3
43+
},
44+
"file_extension": ".py",
45+
"mimetype": "text/x-python",
46+
"name": "python",
47+
"nbconvert_exporter": "python",
48+
"pygments_lexer": "ipython3",
49+
"version": "3.7.0"
50+
}
51+
},
52+
"nbformat": 4,
53+
"nbformat_minor": 0
54+
}
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": null,
6+
"metadata": {
7+
"collapsed": false
8+
},
9+
"outputs": [],
10+
"source": [
11+
"%matplotlib inline"
12+
]
13+
},
14+
{
15+
"cell_type": "markdown",
16+
"metadata": {},
17+
"source": [
18+
"\n# Animated line plot\n\n\n\n"
19+
]
20+
},
21+
{
22+
"cell_type": "code",
23+
"execution_count": null,
24+
"metadata": {
25+
"collapsed": false
26+
},
27+
"outputs": [],
28+
"source": [
29+
"import numpy as np\nimport matplotlib.pyplot as plt\nimport matplotlib.animation as animation\n\nfig, ax = plt.subplots()\n\nx = np.arange(0, 2*np.pi, 0.01)\nline, = ax.plot(x, np.sin(x))\n\n\ndef init(): # only required for blitting to give a clean slate.\n line.set_ydata([np.nan] * len(x))\n return line,\n\n\ndef animate(i):\n line.set_ydata(np.sin(x + i / 100)) # update the data.\n return line,\n\n\nani = animation.FuncAnimation(\n fig, animate, init_func=init, interval=2, blit=True, save_count=50)\n\n# To save the animation, use e.g.\n#\n# ani.save(\"movie.mp4\")\n#\n# or\n#\n# from matplotlib.animation import FFMpegWriter\n# writer = FFMpegWriter(fps=15, metadata=dict(artist='Me'), bitrate=1800)\n# ani.save(\"movie.mp4\", writer=writer)\n\nplt.show()"
30+
]
31+
}
32+
],
33+
"metadata": {
34+
"kernelspec": {
35+
"display_name": "Python 3",
36+
"language": "python",
37+
"name": "python3"
38+
},
39+
"language_info": {
40+
"codemirror_mode": {
41+
"name": "ipython",
42+
"version": 3
43+
},
44+
"file_extension": ".py",
45+
"mimetype": "text/x-python",
46+
"name": "python",
47+
"nbconvert_exporter": "python",
48+
"pygments_lexer": "ipython3",
49+
"version": "3.7.0"
50+
}
51+
},
52+
"nbformat": 4,
53+
"nbformat_minor": 0
54+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
"""
2+
=================
3+
Fancytextbox Demo
4+
=================
5+
6+
"""
7+
import matplotlib.pyplot as plt
8+
9+
plt.text(0.6, 0.5, "test", size=50, rotation=30.,
10+
ha="center", va="center",
11+
bbox=dict(boxstyle="round",
12+
ec=(1., 0.5, 0.5),
13+
fc=(1., 0.8, 0.8),
14+
)
15+
)
16+
17+
plt.text(0.5, 0.4, "test", size=50, rotation=-30.,
18+
ha="right", va="top",
19+
bbox=dict(boxstyle="square",
20+
ec=(1., 0.5, 0.5),
21+
fc=(1., 0.8, 0.8),
22+
)
23+
)
24+
25+
plt.show()

0 commit comments

Comments
 (0)