Skip to content

Commit 741b109

Browse files
committed
changes for MEP12/sphinx-gallery compliance
1 parent 558fb80 commit 741b109

16 files changed

+108
-10
lines changed

examples/axisartist/demo_axisline_style.py

+11
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
"""
2+
================
3+
Axis Line Styles
4+
================
5+
6+
This example shows some configurations for axis style.
7+
"""
18

29
from mpl_toolkits.axisartist.axislines import SubplotZero
310
import matplotlib.pyplot as plt
@@ -9,10 +16,14 @@
916
fig.add_subplot(ax)
1017

1118
for direction in ["xzero", "yzero"]:
19+
# adds arrows at the ends of each axis
1220
ax.axis[direction].set_axisline_style("-|>")
21+
22+
# adds X and Y-axis from the origin
1323
ax.axis[direction].set_visible(True)
1424

1525
for direction in ["left", "right", "bottom", "top"]:
26+
# hides boarders
1627
ax.axis[direction].set_visible(False)
1728

1829
x = np.linspace(-0.5, 1., 100)

examples/event_handling/keypress_demo.py

+4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
"""
2+
=========
3+
Key Press
4+
=========
5+
26
Show how to connect to keypress events
37
"""
48
from __future__ import print_function

examples/event_handling/pipong.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
# A matplotlib based game of Pong illustrating one way to write interactive
2-
# animation which are easily ported to multiple backends
3-
# pipong.py was written by Paul Ivanov <http://pirsquared.org>
1+
"""
2+
====
3+
PONG
4+
====
45
6+
A matplotlib based game of Pong illustrating one way to write interactive animation which are easily ported to multiple backends pipong.py was written by Paul Ivanov <http://pirsquared.org>
7+
"""
58
from __future__ import print_function
69

710
import numpy as np

examples/event_handling/poly_editor.py

+4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
"""
2+
===========
3+
Poly Editor
4+
==========
5+
26
This is an example to show how to build cross-GUI applications using
37
matplotlib event handling to interact with objects on the canvas
48

examples/event_handling/resample.py

+9-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,20 @@
1+
"""
2+
===============
3+
Resampling Data
4+
===============
5+
6+
Downsampling lowers the sample rate or sample size of a signal. In this tutorial, the signal is downsampled when the plot is adjusted through dragging and zooming.
7+
"""
8+
19
import numpy as np
210
import matplotlib.pyplot as plt
311

4-
512
# A class that will downsample the data and recompute when zoomed.
613
class DataDisplayDownsampler(object):
714
def __init__(self, xdata, ydata):
815
self.origYData = ydata
916
self.origXData = xdata
10-
self.ratio = 5
17+
self.ratio = 50
1118
self.delta = xdata[-1] - xdata[0]
1219

1320
def downsample(self, xstart, xend):

examples/mplot3d/lines3d_demo.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
'''
2-
Demonstrating plotting a parametric curve in 3D.
2+
================
3+
Parametric Curve
4+
================
5+
6+
This example demonstrates plotting a parametric curve in 3D.
37
'''
48

59
import matplotlib as mpl

examples/mplot3d/lorenz_attractor.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
'''
2-
Plot of the Lorenz Attractor based on Edward Lorenz's 1963 "Deterministic
3-
Nonperiodic Flow" publication.
2+
================
3+
Lorenz Attractor
4+
================
5+
6+
This is an example of plotting Edward Lorenz's 1963 "Deterministic
7+
Nonperiodic Flow" in a 3-dimensional space using mplot3d.
8+
49
http://journals.ametsoc.org/doi/abs/10.1175/1520-0469%281963%29020%3C0130%3ADNF%3E2.0.CO%3B2
510
611
Note: Because this is a simple non-linear ODE, it would be more easily

examples/mplot3d/mixed_subplots_demo.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
"""
2-
Demonstrate the mixing of 2d and 3d subplots.
2+
============================================
3+
Demonstrate the mixing of 2d and 3d subplots
4+
============================================
5+
This example shows a how to plot a 2D and 3D plot on the same figure.
36
"""
47

58
from mpl_toolkits.mplot3d import Axes3D

examples/mplot3d/offset_demo.py

+4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
'''
2+
=========================
3+
Automatic Text Offsetting
4+
=========================
5+
26
This example demonstrates mplot3d's offset text display.
37
As one rotates the 3D figure, the offsets should remain oriented the
48
same way as the axis label, and should also be located "away"

examples/pylab_examples/bar_stacked.py

+9
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
"""
2+
=================
3+
Stacked Bar Graph
4+
=================
5+
6+
This is an example of creating a stacked bar plot with error bars using `plt.bar`.
7+
Note the parameters `yerr` used for error bars, and `bottom` to stack the women's bars on top of the men's bars.
8+
"""
9+
110
# a stacked bar plot with errorbars
211
import numpy as np
312
import matplotlib.pyplot as plt

examples/pylab_examples/dolphin.py

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
"""
2+
=======
3+
Dophins
4+
=======
5+
6+
This example shows how to draw, and manipulate shapes given verticies and nodes using the patches, path and transforms classes.
7+
"""
8+
19
import matplotlib.cm as cm
210
import matplotlib.pyplot as plt
311
from matplotlib.patches import Circle, PathPatch

examples/pylab_examples/fill_between_demo.py

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
"""
2+
==============================
3+
Filling the area between lines
4+
==============================
5+
6+
This example shows how to use fill_between() to color between lines based on user-defined logic.
7+
"""
8+
19
import matplotlib.pyplot as plt
210
import numpy as np
311

examples/pylab_examples/geo_demo.py

+9
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
"""
2+
======================
3+
Geographic Projections
4+
======================
5+
6+
This shows 4 possible projections using subplot.
7+
Matplotlib also supports the <a href='http://matplotlib.org/basemap/'>Basemaps Toolkit</a> for geographic projections.
8+
"""
9+
110
import matplotlib.pyplot as plt
211

312
plt.figure()

examples/pylab_examples/log_test.py

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
"""
2+
========
3+
Log Axis
4+
========
5+
6+
This is an example of assigning a log-scale for the x-axis using `semilogx`.
7+
"""
8+
19
import matplotlib.pyplot as plt
210
import numpy as np
311

examples/pylab_examples/mri_demo.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1-
"""Displays an MRI image."""
1+
"""
2+
===
3+
MRI
4+
===
5+
6+
This example illustrates how to read an image (of an MRI) into a numpy array, and display it in greyscale using `ax.imshow`.
7+
8+
"""
29

310
import matplotlib.pyplot as plt
411
import matplotlib.cbook as cbook

examples/text_labels_and_annotations/rainbow_text.py

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# -*- coding: utf-8 -*-
22
"""
3+
=========================
4+
Selective Text Coloration
5+
=========================
6+
37
The example shows how to string together several text objects.
48
59
HISTORY

0 commit comments

Comments
 (0)