diff --git a/examples/axisartist/demo_axisline_style.py b/examples/axisartist/demo_axisline_style.py index a8e2c7ada5d7..7823e9c52b12 100644 --- a/examples/axisartist/demo_axisline_style.py +++ b/examples/axisartist/demo_axisline_style.py @@ -1,3 +1,10 @@ +""" +================ +Axis line styles +================ + +This example shows some configurations for axis style. +""" from mpl_toolkits.axisartist.axislines import SubplotZero import matplotlib.pyplot as plt @@ -9,10 +16,14 @@ fig.add_subplot(ax) for direction in ["xzero", "yzero"]: + # adds arrows at the ends of each axis ax.axis[direction].set_axisline_style("-|>") + + # adds X and Y-axis from the origin ax.axis[direction].set_visible(True) for direction in ["left", "right", "bottom", "top"]: + # hides borders ax.axis[direction].set_visible(False) x = np.linspace(-0.5, 1., 100) diff --git a/examples/event_handling/keypress_demo.py b/examples/event_handling/keypress_demo.py index e36eda6bfb72..aa0a4d249c47 100755 --- a/examples/event_handling/keypress_demo.py +++ b/examples/event_handling/keypress_demo.py @@ -1,4 +1,8 @@ """ +========= +Key Press +========= + Show how to connect to keypress events """ from __future__ import print_function diff --git a/examples/event_handling/pipong.py b/examples/event_handling/pipong.py index 89ab36ef9b36..8f0318adb3a1 100755 --- a/examples/event_handling/pipong.py +++ b/examples/event_handling/pipong.py @@ -1,7 +1,12 @@ -# 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 - +""" +==== +Pong +==== + +A Matplotlib based game of Pong illustrating one way to write interactive +animations which are easily ported to multiple backends pipong.py was written +by Paul Ivanov. +""" from __future__ import print_function import numpy as np diff --git a/examples/event_handling/poly_editor.py b/examples/event_handling/poly_editor.py index df95a95d11fe..045d85aa517d 100644 --- a/examples/event_handling/poly_editor.py +++ b/examples/event_handling/poly_editor.py @@ -1,7 +1,10 @@ """ -This is an example to show how to build cross-GUI applications using -matplotlib event handling to interact with objects on the canvas +=========== +Poly Editor +=========== +This is an example to show how to build cross-GUI applications using +matplotlib event handling to interact with objects on the canvas. """ import numpy as np from matplotlib.lines import Line2D diff --git a/examples/event_handling/resample.py b/examples/event_handling/resample.py index 1b380a06cb96..84ba3ee6539b 100644 --- a/examples/event_handling/resample.py +++ b/examples/event_handling/resample.py @@ -1,3 +1,13 @@ +""" +=============== +Resampling Data +=============== + +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. +""" + import numpy as np import matplotlib.pyplot as plt diff --git a/examples/mplot3d/lines3d_demo.py b/examples/mplot3d/lines3d_demo.py index 8e73a301b39c..34ef9328c663 100644 --- a/examples/mplot3d/lines3d_demo.py +++ b/examples/mplot3d/lines3d_demo.py @@ -1,5 +1,9 @@ ''' -Demonstrating plotting a parametric curve in 3D. +================ +Parametric Curve +================ + +This example demonstrates plotting a parametric curve in 3D. ''' import matplotlib as mpl diff --git a/examples/mplot3d/lorenz_attractor.py b/examples/mplot3d/lorenz_attractor.py index 9fceb0af149d..c90b8b9f8fd3 100644 --- a/examples/mplot3d/lorenz_attractor.py +++ b/examples/mplot3d/lorenz_attractor.py @@ -1,6 +1,11 @@ ''' -Plot of the Lorenz Attractor based on Edward Lorenz's 1963 "Deterministic -Nonperiodic Flow" publication. +================ +Lorenz Attractor +================ + +This is an example of plotting Edward Lorenz's 1963 "Deterministic +Nonperiodic Flow" in a 3-dimensional space using mplot3d. + http://journals.ametsoc.org/doi/abs/10.1175/1520-0469%281963%29020%3C0130%3ADNF%3E2.0.CO%3B2 Note: Because this is a simple non-linear ODE, it would be more easily diff --git a/examples/mplot3d/mixed_subplots_demo.py b/examples/mplot3d/mixed_subplots_demo.py index f7788e0add78..6416711903d3 100644 --- a/examples/mplot3d/mixed_subplots_demo.py +++ b/examples/mplot3d/mixed_subplots_demo.py @@ -1,5 +1,9 @@ """ -Demonstrate the mixing of 2d and 3d subplots. +============================================ +Demonstrate the mixing of 2d and 3d subplots +============================================ + +This example shows a how to plot a 2D and 3D plot on the same figure. """ from mpl_toolkits.mplot3d import Axes3D diff --git a/examples/mplot3d/offset_demo.py b/examples/mplot3d/offset_demo.py index c4f6d35e021a..da846c8cc26a 100644 --- a/examples/mplot3d/offset_demo.py +++ b/examples/mplot3d/offset_demo.py @@ -1,4 +1,8 @@ ''' +========================= +Automatic Text Offsetting +========================= + This example demonstrates mplot3d's offset text display. As one rotates the 3D figure, the offsets should remain oriented the same way as the axis label, and should also be located "away" diff --git a/examples/pylab_examples/bar_stacked.py b/examples/pylab_examples/bar_stacked.py index 67ef657a8eea..9bf90cce8c08 100755 --- a/examples/pylab_examples/bar_stacked.py +++ b/examples/pylab_examples/bar_stacked.py @@ -1,3 +1,13 @@ +""" +================= +Stacked Bar Graph +================= + +This is an example of creating a stacked bar plot with error bars using +`plt.bar`. Note the parameters `yerr` used for error bars, and `bottom` +to stack the women's bars on top of the men's bars. +""" + # a stacked bar plot with errorbars import numpy as np import matplotlib.pyplot as plt diff --git a/examples/pylab_examples/dolphin.py b/examples/pylab_examples/dolphin.py index 3e876180589f..cbdc1691536f 100644 --- a/examples/pylab_examples/dolphin.py +++ b/examples/pylab_examples/dolphin.py @@ -1,3 +1,12 @@ +""" +======== +Dolphins +======== + +This example shows how to draw, and manipulate shapes given vertices and nodes +using the `patches`, `path` and `transforms` classes. +""" + import matplotlib.cm as cm import matplotlib.pyplot as plt from matplotlib.patches import Circle, PathPatch diff --git a/examples/pylab_examples/fill_between_demo.py b/examples/pylab_examples/fill_between_demo.py index b3653e456ce5..2b065ed42f60 100644 --- a/examples/pylab_examples/fill_between_demo.py +++ b/examples/pylab_examples/fill_between_demo.py @@ -1,3 +1,12 @@ +""" +============================== +Filling the area between lines +============================== + +This example shows how to use `fill_between` to color between lines based on +user-defined logic. +""" + import matplotlib.pyplot as plt import numpy as np diff --git a/examples/pylab_examples/geo_demo.py b/examples/pylab_examples/geo_demo.py index 9ef96b2b564c..21859314ddae 100644 --- a/examples/pylab_examples/geo_demo.py +++ b/examples/pylab_examples/geo_demo.py @@ -1,3 +1,15 @@ +""" +====================== +Geographic Projections +====================== + +This shows 4 possible projections using subplot. +Matplotlib also supports +Basemaps Toolkit and +Cartopy +for geographic projections. +""" + import matplotlib.pyplot as plt plt.figure() diff --git a/examples/pylab_examples/log_test.py b/examples/pylab_examples/log_test.py index 0aa2a410ee8b..7b6b4253ddcd 100644 --- a/examples/pylab_examples/log_test.py +++ b/examples/pylab_examples/log_test.py @@ -1,3 +1,11 @@ +""" +======== +Log Axis +======== + +This is an example of assigning a log-scale for the x-axis using `semilogx`. +""" + import matplotlib.pyplot as plt import numpy as np diff --git a/examples/pylab_examples/mri_demo.py b/examples/pylab_examples/mri_demo.py index 0840e5222f46..a240ab45c233 100755 --- a/examples/pylab_examples/mri_demo.py +++ b/examples/pylab_examples/mri_demo.py @@ -1,4 +1,12 @@ -"""Displays an MRI image.""" +""" +=== +MRI +=== + +This example illustrates how to read an image (of an MRI) into a NumPy array, +and display it in greyscale using `imshow`. + +""" import matplotlib.pyplot as plt import matplotlib.cbook as cbook diff --git a/examples/text_labels_and_annotations/rainbow_text.py b/examples/text_labels_and_annotations/rainbow_text.py index 95142175ce3d..186362b4bc52 100644 --- a/examples/text_labels_and_annotations/rainbow_text.py +++ b/examples/text_labels_and_annotations/rainbow_text.py @@ -1,5 +1,9 @@ # -*- coding: utf-8 -*- """ +========================= +Selective Text Coloration +========================= + The example shows how to string together several text objects. HISTORY