Skip to content

changes for MEP12/sphinx-gallery compliance #8466

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

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions examples/axisartist/demo_axisline_style.py
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
by `Paul Ivanov <http://pirsquared.org>`_.
"""
from __future__ import print_function

import numpy as np
Expand Down
7 changes: 5 additions & 2 deletions examples/event_handling/poly_editor.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
10 changes: 10 additions & 0 deletions examples/event_handling/resample.py
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion examples/mplot3d/lines3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
3D parametric curve
===================

Demonstrating plotting a parametric curve in 3D.
This example demonstrates plotting a parametric curve in 3D.
'''

import matplotlib as mpl
Expand Down
8 changes: 4 additions & 4 deletions examples/mplot3d/mixed_subplots.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
"""
==================
2D and 3D subplots
==================
============================================
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
Expand Down
6 changes: 3 additions & 3 deletions examples/mplot3d/offset.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'''
===================
Offset text display
===================
=========================
Automatic Text Offsetting
=========================

This example demonstrates mplot3d's offset text display.
As one rotates the 3D figure, the offsets should remain oriented the
Expand Down
10 changes: 10 additions & 0 deletions examples/pylab_examples/bar_stacked.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
9 changes: 9 additions & 0 deletions examples/pylab_examples/dolphin.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
9 changes: 9 additions & 0 deletions examples/pylab_examples/fill_between_demo.py
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
"""
======================
Geographic Projections
======================

This shows 4 possible projections using subplot.
Matplotlib also supports
`Basemaps Toolkit <http://matplotlib.org/basemap/`_ and
Copy link
Contributor

Choose a reason for hiding this comment

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

wrong markup (and below)
also reflow the paragraph, perhaps

`Cartopy <http://scitools.org.uk/cartopy/`_
for geographic projections.
"""

import matplotlib.pyplot as plt

plt.figure()
Expand Down
8 changes: 8 additions & 0 deletions examples/pylab_examples/log_test.py
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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`.

Copy link
Contributor

Choose a reason for hiding this comment

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

remove empty line

"""

import matplotlib.pyplot as plt
import matplotlib.cbook as cbook
Expand Down