diff --git a/examples/pylab_examples/contour_image.py b/examples/pylab_examples/contour_image.py index 4fa036a9432a..a63b107baa04 100755 --- a/examples/pylab_examples/contour_image.py +++ b/examples/pylab_examples/contour_image.py @@ -24,7 +24,7 @@ Z = (Z1 - Z2) * 10 levels = arange(-2.0, 1.601, 0.4) # Boost the upper limit to avoid truncation - # errors. + # errors. norm = cm.colors.Normalize(vmax=abs(Z).max(), vmin=-abs(Z).max()) cmap = cm.PRGn diff --git a/examples/pylab_examples/demo_agg_filter.py b/examples/pylab_examples/demo_agg_filter.py index 5eefd75c2e9d..3337497675d2 100644 --- a/examples/pylab_examples/demo_agg_filter.py +++ b/examples/pylab_examples/demo_agg_filter.py @@ -11,7 +11,7 @@ def smooth1d(x, window_len): s = np.r_[2*x[0] - x[window_len:1:-1], x, 2*x[-1] - x[-1:-window_len:-1]] w = np.hanning(window_len) y = np.convolve(w/w.sum(), s, mode='same') - return y[window_len - 1 : -window_len + 1] + return y[window_len-1:-window_len+1] def smooth2d(A, sigma=3): diff --git a/examples/pylab_examples/pie_demo2.py b/examples/pylab_examples/pie_demo2.py index 43fb4a24a12c..c96d5a83ccdc 100644 --- a/examples/pylab_examples/pie_demo2.py +++ b/examples/pylab_examples/pie_demo2.py @@ -44,11 +44,10 @@ plt.subplot(the_grid[1, 1], aspect=1) +# Turn off shadow for tiny plot with exploded slice. patches, texts, autotexts = plt.pie(fracs, explode=explode, labels=labels, autopct='%.0f%%', shadow=False, radius=0.5) - # Turn off shadow for tiny plot - # with exploded slice. for t in texts: t.set_size('smaller') for t in autotexts: diff --git a/examples/pylab_examples/stackplot_demo.py b/examples/pylab_examples/stackplot_demo.py index ba5d1d202f9e..f10ced74a251 100644 --- a/examples/pylab_examples/stackplot_demo.py +++ b/examples/pylab_examples/stackplot_demo.py @@ -1,7 +1,10 @@ import numpy as np from matplotlib import pyplot as plt -fnx = lambda: np.random.randint(5, 50, 10) + +def fnx(): + return np.random.randint(5, 50, 10) + y = np.row_stack((fnx(), fnx(), fnx())) x = np.arange(10) diff --git a/examples/pylab_examples/usetex_demo.py b/examples/pylab_examples/usetex_demo.py index 07c1ef4cfa55..f29173af3f4d 100644 --- a/examples/pylab_examples/usetex_demo.py +++ b/examples/pylab_examples/usetex_demo.py @@ -13,7 +13,7 @@ X, X < 0, 'k--', # sharp interface linewidth=5) -## legend +# legend pylab.legend((r'phase field', r'level set', r'composition', r'sharp interface'), shadow=True, loc=(0.01, 0.55)) ltext = pylab.gca().get_legend().get_texts() diff --git a/examples/user_interfaces/interactive2.py b/examples/user_interfaces/interactive2.py index 9d809bd9554c..6e174b0b7170 100755 --- a/examples/user_interfaces/interactive2.py +++ b/examples/user_interfaces/interactive2.py @@ -169,7 +169,7 @@ def __init__(self): self.mark = self.text.get_buffer().create_mark("End", self.text.get_buffer().get_end_iter(), False) - # setup colors + # setup colors self.style_banner = gtk.TextTag("banner") self.style_banner.set_property("foreground", "saddle brown")