Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Add example usage to docstring.

  • Loading branch information...
commit f8b4d1908430663a396fe6878e974bfb2df70e1f 1 parent 26b4255
Damon McDougall authored July 14, 2012

Showing 1 changed file with 10 additions and 0 deletions. Show diff stats Hide diff stats

  1. 10  lib/matplotlib/mlab.py
10  lib/matplotlib/mlab.py
@@ -3194,6 +3194,16 @@ def offset_line(y, yerr):
3194 3194
       component-wise.
3195 3195
     o A tuple of length 2. In this case, yerr[0] is the error below *y* and
3196 3196
       yerr[1] is error above *y*.
  3197
+
  3198
+    For example:
  3199
+
  3200
+    from pylab import *
  3201
+    x = linspace(0, 2*pi, num=100, endpoint=True)
  3202
+    y = sin(x)
  3203
+    y_minus, y_plus = mlab.offset_line(y, 0.1)
  3204
+    plot(x, y)
  3205
+    fill_between(x, ym, y2=yp)
  3206
+    show()
3197 3207
     """
3198 3208
     if cbook.is_numlike(yerr) or (cbook.iterable(yerr) and len(yerr) == len(y)):
3199 3209
         ymin = y - yerr

0 notes on commit f8b4d19

Please sign in to comment.
Something went wrong with that request. Please try again.