Skip to content

Commit

Permalink
examples: remove newlines @eof + remove spaces/tabs from emtpy lines
Browse files Browse the repository at this point in the history
steps to reproduce (autopep8 -i --select E111 */*.py) + remove changes
in non-empty lines

Signed-off-by: Thomas Hisch <t.hisch@gmail.com>
  • Loading branch information
twmr committed Sep 14, 2014
1 parent 583ae91 commit 4f0a481
Show file tree
Hide file tree
Showing 106 changed files with 30 additions and 175 deletions.
2 changes: 0 additions & 2 deletions examples/color/color_cycle_demo.py
Expand Up @@ -30,5 +30,3 @@
# Tweak spacing between subplots to prevent labels from overlapping
plt.subplots_adjust(hspace=0.3)
plt.show()


1 change: 0 additions & 1 deletion examples/event_handling/data_browser.py
Expand Up @@ -79,4 +79,3 @@ def update(self):
fig.canvas.mpl_connect('key_press_event', browser.onpress)

plt.show()

2 changes: 0 additions & 2 deletions examples/event_handling/figure_axes_enter_leave.py
Expand Up @@ -46,5 +46,3 @@ def leave_figure(event):
fig2.canvas.mpl_connect('axes_leave_event', leave_axes)

plt.show()


2 changes: 0 additions & 2 deletions examples/event_handling/idle_and_timeout.py
Expand Up @@ -33,5 +33,3 @@ def on_idle(event):
fig.canvas.mpl_connect('idle_event', on_idle)

plt.show()


2 changes: 0 additions & 2 deletions examples/event_handling/path_editor.py
Expand Up @@ -136,5 +136,3 @@ def motion_notify_callback(self, event):
ax.set_ylim(-3,4)

plt.show()


1 change: 0 additions & 1 deletion examples/event_handling/pick_event_demo.py
Expand Up @@ -172,4 +172,3 @@ def onpick4(event):


plt.show()

5 changes: 0 additions & 5 deletions examples/event_handling/pick_event_demo2.py
Expand Up @@ -36,8 +36,3 @@ def onpick(event):
fig.canvas.mpl_connect('pick_event', onpick)

plt.show()





1 change: 0 additions & 1 deletion examples/event_handling/poly_editor.py
Expand Up @@ -159,4 +159,3 @@ def motion_notify_callback(self, event):
ax.set_xlim((-2,2))
ax.set_ylim((-2,2))
plt.show()

1 change: 0 additions & 1 deletion examples/event_handling/zoom_window.py
Expand Up @@ -36,4 +36,3 @@ def onpress(event):

figsrc.canvas.mpl_connect('button_press_event', onpress)
show()

1 change: 0 additions & 1 deletion examples/images_contours_and_fields/image_demo.py
Expand Up @@ -10,4 +10,3 @@
plt.imshow(image)
plt.axis('off') # clear x- and y-axes
plt.show()

Expand Up @@ -26,4 +26,3 @@
ax2.streamplot(X, Y, U, V, density=0.6, color='k', linewidth=lw)

plt.show()

Expand Up @@ -24,4 +24,3 @@
interpolation='nearest', cmap=plt.cm.gray)

plt.show()

1 change: 0 additions & 1 deletion examples/misc/image_thumbnail.py
Expand Up @@ -27,4 +27,3 @@
outfile = os.path.join(outdir, basename)
fig = image.thumbnail(fname, outfile, scale=0.15)
print('saved thumbnail of %s to %s'%(fname, outfile))

2 changes: 1 addition & 1 deletion examples/misc/svg_filter_pie.py
Expand Up @@ -39,7 +39,7 @@
s.set_gid(w.get_gid()+"_shadow")
s.set_zorder(w.get_zorder() - 0.1)
ax.add_patch(s)


# save
from StringIO import StringIO
Expand Down
1 change: 0 additions & 1 deletion examples/mplot3d/2dcollections3d_demo.py
Expand Up @@ -21,4 +21,3 @@
ax.set_zlim3d(0, 1)

plt.show()

1 change: 0 additions & 1 deletion examples/mplot3d/bars3d_demo.py
Expand Up @@ -19,4 +19,3 @@
ax.set_zlabel('Z')

plt.show()

1 change: 0 additions & 1 deletion examples/mplot3d/contour3d_demo.py
Expand Up @@ -9,4 +9,3 @@
ax.clabel(cset, fontsize=9, inline=1)

plt.show()

1 change: 0 additions & 1 deletion examples/mplot3d/contour3d_demo2.py
Expand Up @@ -9,4 +9,3 @@
ax.clabel(cset, fontsize=9, inline=1)

plt.show()

1 change: 0 additions & 1 deletion examples/mplot3d/contour3d_demo3.py
Expand Up @@ -18,4 +18,3 @@
ax.set_zlim(-100, 100)

plt.show()

1 change: 0 additions & 1 deletion examples/mplot3d/contourf3d_demo.py
Expand Up @@ -9,4 +9,3 @@
ax.clabel(cset, fontsize=9, inline=1)

plt.show()

1 change: 0 additions & 1 deletion examples/mplot3d/contourf3d_demo2.py
Expand Up @@ -23,4 +23,3 @@
ax.set_zlim(-100, 100)

plt.show()

1 change: 0 additions & 1 deletion examples/mplot3d/hist3d_demo.py
Expand Up @@ -20,4 +20,3 @@
ax.bar3d(xpos, ypos, zpos, dx, dy, dz, color='b', zsort='average')

plt.show()

1 change: 0 additions & 1 deletion examples/mplot3d/lines3d_demo.py
Expand Up @@ -16,4 +16,3 @@
ax.legend()

plt.show()

1 change: 0 additions & 1 deletion examples/mplot3d/lorenz_attractor.py
Expand Up @@ -47,4 +47,3 @@ def lorenz(x, y, z, s=10, r=28, b=2.667) :
ax.set_title("Lorenz Attractor")

plt.show()

1 change: 0 additions & 1 deletion examples/mplot3d/mixed_subplots_demo.py
Expand Up @@ -47,4 +47,3 @@ def f(t):
ax.set_zlim3d(-1, 1)

plt.show()

1 change: 0 additions & 1 deletion examples/mplot3d/offset_demo.py
Expand Up @@ -23,4 +23,3 @@
ax.set_zlim(0, 2)

plt.show()

1 change: 0 additions & 1 deletion examples/mplot3d/polys3d_demo.py
Expand Up @@ -30,4 +30,3 @@
ax.set_zlim3d(0, 1)

plt.show()

1 change: 0 additions & 1 deletion examples/mplot3d/quiver3d_demo.py
Expand Up @@ -17,4 +17,3 @@
ax.quiver(x, y, z, u, v, w, length=0.1)

plt.show()

1 change: 0 additions & 1 deletion examples/mplot3d/rotate_axes3d_demo.py
Expand Up @@ -12,4 +12,3 @@
for angle in range(0, 360):
ax.view_init(30, angle)
plt.draw()

1 change: 0 additions & 1 deletion examples/mplot3d/scatter3d_demo.py
Expand Up @@ -20,4 +20,3 @@ def randrange(n, vmin, vmax):
ax.set_zlabel('Z Label')

plt.show()

1 change: 0 additions & 1 deletion examples/mplot3d/subplot3d_demo.py
Expand Up @@ -29,4 +29,3 @@
ax.plot_wireframe(X, Y, Z, rstride=10, cstride=10)

plt.show()

1 change: 0 additions & 1 deletion examples/mplot3d/surface3d_demo.py
Expand Up @@ -21,4 +21,3 @@
fig.colorbar(surf, shrink=0.5, aspect=5)

plt.show()

1 change: 0 additions & 1 deletion examples/mplot3d/surface3d_demo2.py
Expand Up @@ -14,4 +14,3 @@
ax.plot_surface(x, y, z, rstride=4, cstride=4, color='b')

plt.show()

1 change: 0 additions & 1 deletion examples/mplot3d/surface3d_demo3.py
Expand Up @@ -27,4 +27,3 @@
ax.w_zaxis.set_major_locator(LinearLocator(6))

plt.show()

1 change: 0 additions & 1 deletion examples/mplot3d/text3d_demo.py
Expand Up @@ -25,4 +25,3 @@
ax.set_zlabel('Z axis')

plt.show()

1 change: 0 additions & 1 deletion examples/mplot3d/wire3d_demo.py
Expand Up @@ -8,4 +8,3 @@
ax.plot_wireframe(X, Y, Z, rstride=10, cstride=10)

plt.show()

4 changes: 0 additions & 4 deletions examples/pylab_examples/anchored_artists.py
Expand Up @@ -108,7 +108,3 @@ def __init__(self, width, height, xdescent, ydescent,

plt.draw()
plt.show()




1 change: 0 additions & 1 deletion examples/pylab_examples/arctest.py
Expand Up @@ -16,4 +16,3 @@ def f(t):
setp(l, 'markerfacecolor', 'b')

show()

5 changes: 0 additions & 5 deletions examples/pylab_examples/axis_equal_demo.py
Expand Up @@ -29,8 +29,3 @@
title('still equal after adding line',fontsize=10)

show()





1 change: 0 additions & 1 deletion examples/pylab_examples/barcode_demo.py
Expand Up @@ -23,4 +23,3 @@


show()

1 change: 0 additions & 1 deletion examples/pylab_examples/boxplot_demo.py
Expand Up @@ -55,4 +55,3 @@
boxplot(data)

show()

2 changes: 0 additions & 2 deletions examples/pylab_examples/clippedline.py
Expand Up @@ -55,5 +55,3 @@ def draw(self, renderer):
ax.set_xlim(10,30)
ax.set_ylim(-1.1,1.1)
show()


2 changes: 0 additions & 2 deletions examples/pylab_examples/cohere_demo.py
Expand Up @@ -32,5 +32,3 @@
cxy, f = plt.cohere(s1, s2, 256, 1./dt)
plt.ylabel('coherence')
plt.show()


1 change: 0 additions & 1 deletion examples/pylab_examples/colours.py
Expand Up @@ -50,4 +50,3 @@ def get_colours(n):
(base[start+1] * x))

return [pastel(c) for c in colours[0:n]]

1 change: 0 additions & 1 deletion examples/pylab_examples/contour_label_demo.py
Expand Up @@ -85,4 +85,3 @@ def __repr__(self):
plt.title("$100^Z$")

plt.show()

1 change: 0 additions & 1 deletion examples/pylab_examples/contourf_demo.py
Expand Up @@ -104,4 +104,3 @@
ax.locator_params(nbins=4)

plt.show()

2 changes: 0 additions & 2 deletions examples/pylab_examples/contourf_log.py
Expand Up @@ -44,5 +44,3 @@
cbar = P.colorbar()

P.show()


1 change: 0 additions & 1 deletion examples/pylab_examples/coords_report.py
Expand Up @@ -16,4 +16,3 @@ def millions(x):
plot(x, y, 'o')

show()

2 changes: 0 additions & 2 deletions examples/pylab_examples/csd_demo.py
Expand Up @@ -32,5 +32,3 @@
cxy, f = plt.csd(s1, s2, 256, 1./dt)
plt.ylabel('CSD (db)')
plt.show()


1 change: 0 additions & 1 deletion examples/pylab_examples/cursor_demo.py
Expand Up @@ -78,4 +78,3 @@ def mouse_move(self, event):
ax.plot(t, s, 'o')
axis([0,1,-1,1])
show()

1 change: 0 additions & 1 deletion examples/pylab_examples/custom_cmap.py
Expand Up @@ -189,4 +189,3 @@
plt.suptitle('Custom Blue-Red colormaps', fontsize=16)

plt.show()

1 change: 0 additions & 1 deletion examples/pylab_examples/custom_figure_class.py
Expand Up @@ -19,4 +19,3 @@ def __init__(self, *args, **kwargs):
ax.plot([1,2,3])

show()

1 change: 0 additions & 1 deletion examples/pylab_examples/dashpointlabel.py
Expand Up @@ -35,4 +35,3 @@
ax.set_ylim((0.0, 5.0))

plt.show()

4 changes: 1 addition & 3 deletions examples/pylab_examples/demo_agg_filter.py
Expand Up @@ -311,7 +311,7 @@ def light_filter_pie(ax):


if 1:

plt.figure(1, figsize=(6, 6))
plt.subplots_adjust(left=0.05, right=0.95)

Expand All @@ -330,5 +330,3 @@ def light_filter_pie(ax):
ax.set_frame_on(True)

plt.show()


1 change: 0 additions & 1 deletion examples/pylab_examples/demo_ribbon_box.py
Expand Up @@ -132,4 +132,3 @@ def draw(self, renderer, *args, **kwargs):

fig.savefig('ribbon_box.png')
plt.show()

8 changes: 4 additions & 4 deletions examples/pylab_examples/demo_text_path.py
Expand Up @@ -31,7 +31,7 @@ def __init__(self, path, bbox_image, **kwargs):
def set_facecolor(self, color):
"""simply ignore facecolor"""
mpatches.PathPatch.set_facecolor(self, "none")

def _init_bbox_image(self, im):

bbox_image = BboxImage(self.get_window_extent,
Expand All @@ -55,7 +55,7 @@ def draw(self, renderer=None):
if 1:

usetex = plt.rcParams["text.usetex"]

fig = plt.figure(1)

# EXAMPLE 1
Expand Down Expand Up @@ -86,10 +86,10 @@ def draw(self, renderer=None):
r = r"\mbox{textpath supports mathtext \& \TeX}"
else:
r = r"textpath supports mathtext & TeX"

text_path = TextPath((0, 0), r,
size=20, usetex=usetex)

p1 = PathPatch(text_path, ec="w", lw=3, fc="w", alpha=0.9,
transform=IdentityTransform())
p2 = PathPatch(text_path, ec="none", fc="k",
Expand Down
3 changes: 0 additions & 3 deletions examples/pylab_examples/demo_tight_layout.py
Expand Up @@ -102,6 +102,3 @@ def example_plot(ax):
gs2.update(top=top, bottom=bottom)

plt.show()



2 changes: 0 additions & 2 deletions examples/pylab_examples/ellipse_collection.py
Expand Up @@ -30,5 +30,3 @@
cbar = plt.colorbar(ec)
cbar.set_label('X+Y')
plt.show()


8 changes: 4 additions & 4 deletions examples/pylab_examples/fancybox_demo.py
Expand Up @@ -67,7 +67,7 @@ def test2(ax):
# draws control points for the fancy box.
#l = p_fancy.get_path().vertices
#ax.plot(l[:,0], l[:,1], ".")

draw_bbox(ax, bb)


Expand All @@ -92,15 +92,15 @@ def test3(ax):
# draws control points for the fancy box.
#l = p_fancy.get_path().vertices
#ax.plot(l[:,0], l[:,1], ".")

draw_bbox(ax, bb)


def test4(ax):

# When the aspect ratio of the axes is not 1, the fancy box may
# not be what you expected (green)

p_fancy = FancyBboxPatch((bb.xmin, bb.ymin),
abs(bb.width), abs(bb.height),
boxstyle="round,pad=0.2",
Expand All @@ -122,7 +122,7 @@ def test4(ax):
ax.text(0.1, 0.8,
' boxstyle="round,pad=0.3"\n mutation\\_aspect=.5',
size=10, transform=ax.transAxes)

draw_bbox(ax, bb)


Expand Down
1 change: 0 additions & 1 deletion examples/pylab_examples/fancybox_demo2.py
Expand Up @@ -16,4 +16,3 @@
bbox=dict(boxstyle=stylename, fc="w", ec="k"))
plt.draw()
plt.show()

0 comments on commit 4f0a481

Please sign in to comment.