Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

changes for MEP12/sphinx-gallery compliance #8209

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 11 additions & 0 deletions 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
Expand All @@ -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)
Expand Down
4 changes: 4 additions & 0 deletions examples/event_handling/keypress_demo.py
@@ -1,4 +1,8 @@
"""
=========
Key Press
=========

Show how to connect to keypress events
"""
from __future__ import print_function
Expand Down
13 changes: 9 additions & 4 deletions 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 <http://pirsquared.org>

"""
====
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dot after "multiple backends"

by <a href='http://pirsquared.org'>Paul Ivanov</a>.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am somewhat not surprised by the original author of that example…
ping @ivanov :D

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"""
from __future__ import print_function

import numpy as np
Expand Down
7 changes: 5 additions & 2 deletions 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
==========
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing '='

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One missing =.


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
Expand Down
10 changes: 10 additions & 0 deletions 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

Expand Down
6 changes: 5 additions & 1 deletion 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
Expand Down
9 changes: 7 additions & 2 deletions 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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest using an explicit hyperlink target (http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#hyperlink-targets).

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
Expand Down
6 changes: 5 additions & 1 deletion 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
============================================
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

blank line

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I resolved this?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing blank line after, I think.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I resolved this?


This example shows a how to plot a 2D and 3D plot on the same figure.
"""

from mpl_toolkits.mplot3d import Axes3D
Expand Down
4 changes: 4 additions & 0 deletions 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"
Expand Down
10 changes: 10 additions & 0 deletions 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`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yerr and bottom should use *foo*, not backticks (they are not references to linkable elements).

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
Expand Down
9 changes: 9 additions & 0 deletions 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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Patch, Path, and Transform (references to actual python names).

"""

import matplotlib.cm as cm
import matplotlib.pyplot as plt
from matplotlib.patches import Circle, PathPatch
Expand Down
9 changes: 9 additions & 0 deletions 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

Expand Down
12 changes: 12 additions & 0 deletions examples/pylab_examples/geo_demo.py
@@ -1,3 +1,15 @@
"""
======================
Geographic Projections
======================

This shows 4 possible projections using subplot.
Matplotlib also supports
<a href='http://matplotlib.org/basemap/'>Basemaps Toolkit</a> and
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comment as above regarding hyperlink syntax (either way works).

<a href='http://scitools.org.uk/cartopy/'>Cartopy</a>
for geographic projections.
"""

import matplotlib.pyplot as plt

plt.figure()
Expand Down
8 changes: 8 additions & 0 deletions 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

Expand Down
10 changes: 9 additions & 1 deletion 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
Expand Down
4 changes: 4 additions & 0 deletions 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
Expand Down