8000 Doc yinleon rebase by tacaswell · Pull Request #8860 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Doc yinleon rebase #8860

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

Merged
merged 7 commits into from
Jul 15, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
changes for MEP12/sphinx-gallery compliance
  • Loading branch information
yinleon authored and tacaswell committed Jul 10, 2017
commit 82c52f357dae06be17d501d7dc0ef915414d74a1
11 changes: 8 additions & 3 deletions examples/axisartist/demo_axisline_style.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
"""
===================
Demo Axisline Style
===================
================
Axis Line Styles
================

This example shows some configurations for axis style.
"""

from mpl_toolkits.axisartist.axislines import SubplotZero
Expand All @@ -15,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 boarders
ax.axis[direction].set_visible(False)

x = np.linspace(-0.5, 1., 100)
Expand Down
15 changes: 10 additions & 5 deletions examples/event_handling/resample.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,24 @@
"""
========
Resample
========
===============
Resampling Data
===============


Copy link
Contributor

Choose a reason for hiding this comment

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

remove blank line

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.
Copy link
Contributor

Choose a reason for hiding this comment

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

... except that the example is completely broken (try it). It should either be fixed or removed.

Copy link
Member Author

Choose a reason for hiding this comment

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

It does what it claims, but in a weird way. It always down-samples to every 5th point but also clips the data.

Copy link
Member Author

Choose a reason for hiding this comment

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

re worked this a bit.

It works on zoom, but not pan which seems like a bug Mpl, not in the example.


"""

import numpy as np
import matplotlib.pyplot as plt


# A class that will downsample the data and recompute when zoomed.
class DataDisplayDownsampler(object):
def __init__(self, xdata, ydata):
self.origYData = ydata
self.origXData = xdata
self.ratio = 5
self.ratio = 50
self.delta = xdata[-1] - xdata[0]

def downsample(self, xstart, xend):
Expand Down
8 changes: 4 additions & 4 deletions examples/mplot3d/lines3d.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
'''
===================
3D parametric curve
===================
================
Parametric Curve
================

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

import matplotlib as mpl
Expand Down
11 changes: 6 additions & 5 deletions examples/mplot3d/lorenz_attractor.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
'''
====================
The Lorenz Attractor
====================
================
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.

link below could use proper rst markup too


Plot of the Lorenz Attractor based on Edward Lorenz's 1963 "Deterministic
Nonperiodic Flow" publication.
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
9 changes: 4 additions & 5 deletions examples/mplot3d/mixed_subplots.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
"""
==================
2D and 3D subplots
==================

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.

2D, 3D (see just below)

============================================
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 741A & 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
13 changes: 9 additions & 4 deletions examples/pylab_examples/bar_stacked.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
"""
===========
Bar Stacked
===========
=================
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.
"""

# a stacked bar plot with errorbars
Copy link
Member

Choose a reason for hiding this comment

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

This comment seems redundant now there's a proper description at the top.

import numpy as np
import matplotlib.pyplot as plt

Expand Down
7 changes: 6 additions & 1 deletion examples/pylab_examples/dolphin.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
"""
=======
Dolphin
Dophins
=======


This example shows how to draw, and manipulate shapes given verticies
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
8 changes: 5 additions & 3 deletions examples/pylab_examples/fill_between_demo.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
"""
=================
Fill Between Demo
=================
==============================
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
9 changes: 6 additions & 3 deletions examples/pylab_examples/geo_demo.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
"""
========
Geo Demo
========
======================
Geographic Projections
======================

This shows 4 possible projections using subplot.
Matplotlib also supports the <a href='http://matplotlib.org/basemap/'>Basemaps Toolkit</a> for geographic projections.
"""

import matplotlib.pyplot as plt

plt.figure()
Expand Down
5 changes: 4 additions & 1 deletion examples/pylab_examples/log_test.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
"""
========
Log Test
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
12 changes: 7 additions & 5 deletions examples/pylab_examples/mri_demo.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
"""
========
MRI Demo
========
===
MRI
===

Displays an MRI image.
"""

This example illustrates how to read an image (of an MRI) into a numpy
array, and display it in greyscale using `ax.imshow`.

"""

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