Browse files

remove trailing spaces

svn path=/trunk/matplotlib/; revision=3371
  • Loading branch information...
1 parent e8f4297 commit 1f5345434a8ba40f25b75797cfa555915125d4c0 @NNemec NNemec committed Jun 7, 2007
Showing with 3,304 additions and 3,304 deletions.
  1. +1 −1 examples/agg_resize.py
  2. +2 −2 examples/agg_test.py
  3. +1 −1 examples/anim_tk.py
  4. +5 −5 examples/animation_blit_fltk.py
  5. +8 −8 examples/animation_blit_qt.py
  6. +8 −8 examples/animation_blit_qt4.py
  7. +3 −3 examples/animation_blit_tk.py
  8. +2 −2 examples/animation_blit_wx.py
  9. +2 −2 examples/annotation_demo.py
  10. +1 −1 examples/anscombe.py
  11. +2 −2 examples/axes_demo.py
  12. +2 −2 examples/axes_props.py
  13. +4 −4 examples/clippath_test.py
  14. +5 −5 examples/clippedline.py
  15. +1 −1 examples/colours.py
  16. +1 −1 examples/csd_demo.py
  17. +6 −6 examples/cursor_demo.py
  18. +1 −1 examples/custom_figure_class.py
  19. +2 −2 examples/dannys_example.py
  20. +2 −2 examples/data_helper.py
  21. +1 −1 examples/date_demo_convert.py
  22. +7 −7 examples/dynamic_demo_wx.py
  23. +1 −1 examples/dynamic_image_wxagg.py
  24. +7 −7 examples/dynamic_image_wxagg2.py
  25. +1 −1 examples/embedding_in_qt.py
  26. +3 −3 examples/embedding_in_qt4.py
  27. +11 −11 examples/embedding_in_wx.py
  28. +6 −6 examples/embedding_in_wx2.py
  29. +14 −14 examples/embedding_in_wx3.py
  30. +8 −8 examples/embedding_in_wx4.py
  31. +1 −1 examples/errorbar_demo.py
  32. +2 −2 examples/figimage_demo.py
  33. +2 −2 examples/fill_between.py
  34. +1 −1 examples/font_indexing.py
  35. +2 −2 examples/fonts_demo_kw.py
  36. +23 −23 examples/ftface_props.py
  37. +2 −2 examples/gtk_spreadsheet.py
  38. +2 −2 examples/image_interp.py
  39. +5 −5 examples/interactive.py
  40. +6 −6 examples/interactive2.py
  41. +1 −1 examples/interp_demo.py
  42. +1 −1 examples/keypress_demo.py
  43. +10 −10 examples/lasso_demo.py
  44. +1 −1 examples/layer_images.py
  45. +1 −1 examples/legend_auto.py
  46. +1 −1 examples/legend_demo2.py
  47. +1 −1 examples/line_styles.py
  48. +1 −1 examples/major_minor_demo1.py
  49. +1 −1 examples/major_minor_demo2.py
  50. +1 −1 examples/mathtext_demo.py
  51. +5 −5 examples/mpl_with_glade.py
  52. +8 −8 examples/mri_with_eeg.py
  53. +1 −1 examples/multiline.py
  54. +1 −1 examples/pcolor_demo.py
  55. +1 −1 examples/pcolor_demo2.py
  56. +9 −9 examples/pick_event_demo.py
  57. +5 −5 examples/picker_demo.py
  58. +2 −2 examples/pie_demo.py
  59. +1 −1 examples/polar_scatter.py
  60. +18 −18 examples/poly_editor.py
  61. +18 −18 examples/printing_in_wx.py
  62. +1 −1 examples/pylab_with_gtk.py
  63. +1 −1 examples/pythonic_matplotlib.py
  64. +1 −1 examples/scatter_custom_symbol.py
  65. +1 −1 examples/scatter_profile.py
  66. +4 −4 examples/set_and_get.py
  67. +1 −1 examples/simple3d.py
  68. +10 −10 examples/simple3d_oo.py
  69. +1 −1 examples/stem_plot.py
  70. +5 −5 examples/strip_chart_demo.py
  71. +2 −2 examples/system_monitor.py
  72. +1 −1 examples/tex_demo.py
  73. +1 −1 examples/tex_unicode_demo.py
  74. +1 −1 examples/to_numeric.py
  75. +1 −1 examples/toggle_images.py
  76. +1 −1 examples/unicode_demo.py
  77. +10 −10 examples/units/basic_units.py
  78. +1 −1 examples/units/date_support.py
  79. +1 −1 examples/units/units_sample.py
  80. +2 −2 examples/widgets/buttons.py
  81. +2 −2 examples/widgets/check_buttons.py
  82. +1 −1 examples/widgets/radio_buttons.py
  83. +2 −2 examples/widgets/rectangle_selector.py
  84. +1 −1 examples/widgets/sliders.py
  85. +6 −6 examples/wxcursor_demo.py
  86. +1 −1 examples/zoom_window.py
  87. +2 −2 lib/dateutil/easter.py
  88. +2 −2 lib/dateutil/parser.py
  89. +2 −2 lib/dateutil/rrule.py
  90. +8 −8 lib/dateutil/tz.py
  91. +2 −2 lib/matplotlib/__init__.py
  92. +14 −14 lib/matplotlib/_mathtext_data.py
  93. +5 −5 lib/matplotlib/_pylab_helpers.py
  94. +16 −16 lib/matplotlib/afm.py
  95. +47 −47 lib/matplotlib/agg.py
  96. +1 −1 lib/matplotlib/art3d.py
  97. +2 −2 lib/matplotlib/artist.py
  98. +33 −33 lib/matplotlib/axes.py
  99. +2 −2 lib/matplotlib/axis.py
  100. +11 −11 lib/matplotlib/axis3d.py
  101. +10 −10 lib/matplotlib/backend_bases.py
  102. +2 −2 lib/matplotlib/backends/__init__.py
  103. +4 −4 lib/matplotlib/backends/backend_agg.py
  104. +4 −4 lib/matplotlib/backends/backend_cocoaagg.py
  105. +31 −31 lib/matplotlib/backends/backend_emf.py
  106. +27 −27 lib/matplotlib/backends/backend_gd.py
  107. +1 −1 lib/matplotlib/backends/backend_gtk.py
  108. +8 −8 lib/matplotlib/backends/backend_gtkagg.py
  109. +21 −21 lib/matplotlib/backends/backend_paint.py
  110. +70 −70 lib/matplotlib/backends/backend_pdf.py
  111. +10 −10 lib/matplotlib/backends/backend_ps.py
  112. +33 −33 lib/matplotlib/backends/backend_qt.py
  113. +49 −49 lib/matplotlib/backends/backend_qt4.py
  114. +12 −12 lib/matplotlib/backends/backend_qt4agg.py
  115. +13 −13 lib/matplotlib/backends/backend_qtagg.py
  116. +36 −36 lib/matplotlib/backends/backend_tkagg.py
  117. +20 −20 lib/matplotlib/backends/backend_wx.py
  118. +9 −9 lib/matplotlib/backends/backend_wxagg.py
  119. +2 −2 lib/matplotlib/cbook.py
  120. +17 −17 lib/matplotlib/dates.py
  121. +4 −4 lib/matplotlib/dviread.py
  122. +4 −4 lib/matplotlib/enthought/resource/resource_factory.py
  123. +11 −11 lib/matplotlib/enthought/resource/resource_manager.py
  124. +5 −5 lib/matplotlib/enthought/resource/resource_path.py
  125. +4 −4 lib/matplotlib/enthought/resource/resource_reference.py
  126. +6 −6 lib/matplotlib/enthought/traits/__init__.py
  127. +26 −26 lib/matplotlib/enthought/traits/category.py
  128. +315 −315 lib/matplotlib/enthought/traits/has_traits.py
  129. +102 −102 lib/matplotlib/enthought/traits/standard.py
  130. +32 −32 lib/matplotlib/enthought/traits/trait_base.py
  131. +116 −116 lib/matplotlib/enthought/traits/trait_db.py
  132. +6 −6 lib/matplotlib/enthought/traits/trait_errors.py
  133. +202 −202 lib/matplotlib/enthought/traits/trait_handlers.py
  134. +38 −38 lib/matplotlib/enthought/traits/trait_notifiers.py
  135. +37 −37 lib/matplotlib/enthought/traits/trait_numeric.py
  136. +234 −234 lib/matplotlib/enthought/traits/traits.py
  137. +2 −2 lib/matplotlib/enthought/traits/ui/__init__.py
  138. +54 −54 lib/matplotlib/enthought/traits/ui/editor.py
  139. +12 −12 lib/matplotlib/enthought/traits/ui/editor_factory.py
  140. +26 −26 lib/matplotlib/enthought/traits/ui/editors.py
  141. +64 −64 lib/matplotlib/enthought/traits/ui/group.py
  142. +35 −35 lib/matplotlib/enthought/traits/ui/handler.py
  143. +10 −10 lib/matplotlib/enthought/traits/ui/help.py
  144. +4 −4 lib/matplotlib/enthought/traits/ui/help_template.py
  145. +1 −1 lib/matplotlib/enthought/traits/ui/helper.py
  146. +8 −8 lib/matplotlib/enthought/traits/ui/include.py
  147. +23 −23 lib/matplotlib/enthought/traits/ui/item.py
  148. +5 −5 lib/matplotlib/enthought/traits/ui/menu.py
  149. +3 −3 lib/matplotlib/enthought/traits/ui/null/__init__.py
  150. +9 −9 lib/matplotlib/enthought/traits/ui/null/color_trait.py
  151. +6 −6 lib/matplotlib/enthought/traits/ui/null/font_trait.py
  152. +13 −13 lib/matplotlib/enthought/traits/ui/null/rgb_color_trait.py
  153. +10 −10 lib/matplotlib/enthought/traits/ui/null/rgba_color_trait.py
  154. +32 −32 lib/matplotlib/enthought/traits/ui/null/toolkit.py
  155. +62 −62 lib/matplotlib/enthought/traits/ui/toolkit.py
  156. +230 −230 lib/matplotlib/enthought/traits/ui/tree_node.py
  157. +103 −103 lib/matplotlib/enthought/traits/ui/ui.py
  158. +9 −9 lib/matplotlib/enthought/traits/ui/ui_info.py
  159. +5 −5 lib/matplotlib/enthought/traits/ui/ui_traits.py
  160. +74 −74 lib/matplotlib/enthought/traits/ui/undo.py
  161. +40 −40 lib/matplotlib/enthought/traits/ui/view.py
  162. +30 −30 lib/matplotlib/enthought/traits/ui/view_element.py
  163. +46 −46 lib/matplotlib/enthought/traits/ui/view_elements.py
  164. +6 −6 lib/matplotlib/enthought/util/__init__.py
  165. +1 −1 lib/matplotlib/enthought/util/resource.py
  166. +3 −3 lib/matplotlib/figure.py
  167. +7 −7 lib/matplotlib/font_manager.py
  168. +91 −91 lib/matplotlib/mathtext.py
  169. +17 −17 lib/matplotlib/mathtext2.py
  170. +5 −5 lib/matplotlib/numerix/__init__.py
  171. +1 −1 lib/matplotlib/numerix/_sp_imports.py
  172. +1 −1 lib/matplotlib/numerix/fft/__init__.py
  173. +12 −12 lib/matplotlib/proj3d.py
  174. +170 −170 lib/matplotlib/pyparsing.py
  175. +1 −1 lib/matplotlib/quiver.py
  176. +31 −31 lib/matplotlib/texmanager.py
  177. +8 −8 lib/matplotlib/units.py
  178. +4 −4 lib/matplotlib/widgets.py
  179. +3 −3 lib/pytz/__init__.py
  180. +1 −1 lib/pytz/reference.py
  181. +1 −1 lib/pytz/test_tzinfo.py
  182. +10 −10 lib/pytz/tzinfo.py
  183. +1 −1 license.py
  184. +11 −11 sandbox/units/modified/axes.py
  185. +4 −4 sandbox/units/modified/units.py
  186. +2 −2 setup.py
  187. +1 −1 setupext.py
  188. +2 −2 unit/agg_memleak.py
  189. +1 −1 unit/auto_legend.py
  190. +1 −1 unit/helpers.py
  191. +1 −1 unit/inside_poly_memleak.py
  192. +1 −1 unit/inside_poly_profile.py
  193. +1 −1 unit/memleak_gui.py
  194. +1 −1 unit/memleak_hawaii3.py
  195. +1 −1 unit/memleak_transforms.py
  196. +1 −1 unit/override_builtins.py
  197. +2 −2 unit/test_wxagg.py
  198. +2 −2 unit/transform_memleak.py
  199. +3 −3 unit/transforms_unit.py
View
2 examples/agg_resize.py
@@ -4,4 +4,4 @@
imMatrix = agg.trans_affine(1,0,0,1,0,0)
-interp = agg.span_interpolator_linear(imMatrix);
+interp = agg.span_interpolator_linear(imMatrix);
View
4 examples/agg_test.py
@@ -22,7 +22,7 @@
pf = agg.pixel_format_rgba(rbuf)
rbase = agg.renderer_base_rgba(pf)
-rbase.clear_rgba8(blue)
+rbase.clear_rgba8(blue)
renderer = agg.renderer_scanline_aa_solid_rgba(rbase);
renderer.color_rgba8( red )
@@ -107,7 +107,7 @@
agg.render_scanlines_rgba(rasterizer, scanline, renderer);
## Copy a rectangle from the buffer the rectangle defined by
-## x0,y0->x1,y1 and paste it at xdest, ydest
+## x0,y0->x1,y1 and paste it at xdest, ydest
x0, y0 = 10, 50
x1, y1 = 110, 190
xdest, ydest = 350, 200
View
2 examples/anim_tk.py
@@ -42,7 +42,7 @@ def run(*args):
cnt = updatefig()
if cnt==100: break
print 'elapsed', 100.0/(time.time() - tstart)
-
+
import Tkinter as Tk
manager.window.after(10, run)
manager.show()
View
10 examples/animation_blit_fltk.py
@@ -21,19 +21,19 @@ def __init__(self,ax):
self.tstart = time.time()
def clear(self,event):
- self.background = self.canvas.copy_from_bbox(self.ax.bbox)
+ self.background = self.canvas.copy_from_bbox(self.ax.bbox)
def update(self,ptr):
# restore the clean slate background
if self.background is None:
- self.background = self.canvas.copy_from_bbox(self.ax.bbox)
+ self.background = self.canvas.copy_from_bbox(self.ax.bbox)
self.canvas.restore_region(self.background)
# update the data
- line.set_ydata(nx.sin(x+self.cnt/10.0))
+ line.set_ydata(nx.sin(x+self.cnt/10.0))
# just draw the animated artist
self.ax.draw_artist(line)
# just redraw the axes rectangle
- self.canvas.blit(ax.bbox)
+ self.canvas.blit(ax.bbox)
self.cnt+=1
if self.cnt==1000:
# print the timing info and quit
@@ -48,7 +48,7 @@ def update(self,ptr):
x = nx.arange(0,2*nx.pi,0.01)
line, = p.plot(x, nx.sin(x), animated=True)
p.draw()
-anim=animator(ax)
+anim=animator(ax)
fltk.Fl.add_idle(anim.update)
fltk.Fl.run()
View
16 examples/animation_blit_qt.py
@@ -25,34 +25,34 @@ def __init__(self):
self.ax = p.subplot(111)
self.canvas = self.ax.figure.canvas
self.cnt = 0
-
+
# create the initial line
self.x = nx.arange(0,2*nx.pi,0.01)
self.line, = p.plot(self.x, nx.sin(self.x), animated=True, lw=2)
-
+
self.background = None
-
+
def timerEvent(self, evt):
if self.background is None:
self.background = self.canvas.copy_from_bbox(self.ax.bbox)
-
+
# restore the clean slate background
self.canvas.restore_region(self.background)
# update the data
- self.line.set_ydata(nx.sin(self.x+self.cnt/10.0))
+ self.line.set_ydata(nx.sin(self.x+self.cnt/10.0))
# just draw the animated artist
self.ax.draw_artist(self.line)
# just redraw the axes rectangle
- self.canvas.blit(self.ax.bbox)
-
+ self.canvas.blit(self.ax.bbox)
+
if self.cnt==ITERS:
# print the timing info and quit
print 'FPS:' , ITERS/(time.time()-self.tstart)
sys.exit()
else:
self.cnt += 1
-
+
p.subplots_adjust(left=0.3, bottom=0.3) # check for flipy bugs
p.grid() # to ensure proper background restore
View
16 examples/animation_blit_qt4.py
@@ -20,34 +20,34 @@ def __init__(self):
self.ax = p.subplot(111)
self.canvas = self.ax.figure.canvas
self.cnt = 0
-
+
# create the initial line
self.x = nx.arange(0,2*nx.pi,0.01)
self.line, = p.plot(self.x, nx.sin(self.x), animated=True, lw=2)
-
+
self.background = None
-
+
def timerEvent(self, evt):
if self.background is None:
self.background = self.canvas.copy_from_bbox(self.ax.bbox)
-
+
# restore the clean slate background
self.canvas.restore_region(self.background)
# update the data
- self.line.set_ydata(nx.sin(self.x+self.cnt/10.0))
+ self.line.set_ydata(nx.sin(self.x+self.cnt/10.0))
# just draw the animated artist
self.ax.draw_artist(self.line)
# just redraw the axes rectangle
- self.canvas.blit(self.ax.bbox)
-
+ self.canvas.blit(self.ax.bbox)
+
if self.cnt==ITERS:
# print the timing info and quit
print 'FPS:' , ITERS/(time.time()-self.tstart)
sys.exit()
else:
self.cnt += 1
-
+
p.subplots_adjust(left=0.3, bottom=0.3) # check for flipy bugs
p.grid() # to ensure proper background restore
View
6 examples/animation_blit_tk.py
@@ -26,19 +26,19 @@ def run(*args):
# restore the clean slate background
canvas.restore_region(background)
# update the data
- line.set_ydata(nx.sin(x+run.cnt/10.0))
+ line.set_ydata(nx.sin(x+run.cnt/10.0))
# just draw the animated artist
ax.draw_artist(line)
# just redraw the axes rectangle
- canvas.blit(ax.bbox)
+ canvas.blit(ax.bbox)
if run.cnt==1000:
# print the timing info and quit
print 'FPS:' , 1000/(time.time()-tstart)
sys.exit()
run.cnt += 1
-run.cnt = 0
+run.cnt = 0
p.subplots_adjust(left=0.3, bottom=0.3) # check for flipy bugs
View
4 examples/animation_blit_wx.py
@@ -46,7 +46,7 @@ def update_line(*args):
# restore the clean slate background
canvas.restore_region(update_line.background)
# update the data
- line.set_ydata(nx.sin(x+update_line.cnt/10.0))
+ line.set_ydata(nx.sin(x+update_line.cnt/10.0))
# just draw the animated artist
ax.draw_artist(line)
# just redraw the axes rectangle
@@ -67,7 +67,7 @@ def update_line(*args):
update_line.cnt += 1
wx.WakeUpIdle()
-
+
update_line.cnt = 0
View
4 examples/annotation_demo.py
@@ -124,11 +124,11 @@
verticalalignment='bottom',
clip_on=True, # clip to the axes bounding box
)
-
+
ax.set_xlim(-20, 20)
ax.set_ylim(-20, 20)
fig.savefig('annotation_ellipse')
-
+
#fig.savefig('annotation_demo.png')
View
2 examples/anscombe.py
@@ -25,7 +25,7 @@ def fit(x):
subplot(221)
plot(x,y1,'ks', xfit, fit(xfit), 'r-', lw=2)
-axis([2,20,2,14])
+axis([2,20,2,14])
setp(gca(), xticklabels=[], yticks=(4,8,12), xticks=(0,10,20))
text(3,12, 'I', fontsize=20)
View
4 examples/axes_demo.py
@@ -1,5 +1,5 @@
#!/usr/bin/env python
-
+
from pylab import *
# create some data to use for the plot
@@ -27,7 +27,7 @@
plot(t[:len(r)], r)
title('Impulse response')
setp(a, xlim=(0,.2), xticks=[], yticks=[])
-
+
#savefig('../figures/axes_demo.eps')
#savefig('../figures/axes_demo.png')
show()
View
4 examples/axes_props.py
@@ -42,9 +42,9 @@
ticklines = ax.get_xticklines()
ticklines.extend( ax.get_yticklines() )
-gridlines = ax.get_xgridlines()
+gridlines = ax.get_xgridlines()
gridlines.extend( ax.get_ygridlines() )
-ticklabels = ax.get_xticklabels()
+ticklabels = ax.get_xticklabels()
ticklabels.extend( ax.get_yticklabels() )
for line in ticklines:
View
8 examples/clippath_test.py
@@ -18,19 +18,19 @@ def __init__(self, ax, line):
ax.add_patch(self.poly)
self.canvas.mpl_connect('button_press_event', self.onpress)
self.canvas.mpl_connect('button_release_event', self.onrelease)
- self.canvas.mpl_connect('motion_notify_event', self.onmove)
+ self.canvas.mpl_connect('motion_notify_event', self.onmove)
self.x, self.y = None, None
def onpress(self, event):
self.x, self.y = event.x, event.y
-
+
def onrelease(self, event):
self.x, self.y = None, None
def onmove(self, event):
- if self.x is None: return
+ if self.x is None: return
dx = event.x - self.x
dy = event.y - self.y
self.x, self.y = event.x, event.y
@@ -54,7 +54,7 @@ def _clip(self):
path.close_polygon()
self.line.set_clip_path(path)
self.canvas.draw_idle()
-
+
fig = figure(figsize=(8,8))
ax = fig.add_subplot(111)
View
10 examples/clippedline.py
@@ -21,7 +21,7 @@ def set_data(self, *args, **kwargs):
Line2D.set_data(self, *args, **kwargs)
self.xorig = nx.array(self._x)
self.yorig = nx.array(self._y)
-
+
def draw(self, renderer):
xlim = self.ax.get_xlim()
@@ -35,8 +35,8 @@ def draw(self, renderer):
else:
self._marker = None
self._linestyle = '-'
-
-
+
+
Line2D.draw(self, renderer)
@@ -50,5 +50,5 @@ def draw(self, renderer):
ax.set_xlim(10,30)
ax.set_ylim(-1.1,1.1)
show()
-
-
+
+
View
2 examples/colours.py
@@ -10,7 +10,7 @@
def pastel(colour, weight=2.4):
""" Convert colour into a nice pastel shade"""
rgb = asarray(colorConverter.to_rgb(colour))
- # scale colour
+ # scale colour
maxc = max(rgb)
if maxc < 1.0 and maxc > 0:
# scale colour
View
2 examples/csd_demo.py
@@ -17,7 +17,7 @@
cnse2 = cnse2[:len(t)]
# two signals with a coherent part and a random part
-s1 = 0.01*sin(2*pi*10*t) + cnse1
+s1 = 0.01*sin(2*pi*10*t) + cnse1
s2 = 0.01*sin(2*pi*10*t) + cnse2
subplot(211)
View
12 examples/cursor_demo.py
@@ -19,9 +19,9 @@ def __init__(self, ax):
# text location in axes coords
self.txt = ax.text( 0.7, 0.9, '', transform=ax.transAxes)
-
+
def mouse_move(self, event):
- if not event.inaxes: return
+ if not event.inaxes: return
ax = event.inaxes
minx, maxx = ax.get_xlim()
miny, maxy = ax.get_ylim()
@@ -48,10 +48,10 @@ def __init__(self, ax, x, y):
self.y = y
# text location in axes coords
self.txt = ax.text( 0.7, 0.9, '', transform=ax.transAxes)
-
+
def mouse_move(self, event):
- if not event.inaxes: return
+ if not event.inaxes: return
ax = event.inaxes
minx, maxx = ax.get_xlim()
miny, maxy = ax.get_ylim()
@@ -60,7 +60,7 @@ def mouse_move(self, event):
indx = searchsorted(self.x, [x])[0]
x = self.x[indx]
- y = self.y[indx]
+ y = self.y[indx]
# update the line positions
self.lx.set_data( (minx, maxx), (y, y) )
self.ly.set_data( (x, x), (miny, maxy) )
@@ -74,7 +74,7 @@ def mouse_move(self, event):
ax = subplot(111)
cursor = Cursor(ax)
-#cursor = SnaptoCursor(ax, t, s)
+#cursor = SnaptoCursor(ax, t, s)
connect('motion_notify_event', cursor.mouse_move)
ax.plot(t, s, 'o')
View
2 examples/custom_figure_class.py
@@ -19,4 +19,4 @@ def __init__(self, *args, **kwargs):
fig.savefig('test.png')
fig.savefig('test.ps')
show()
-
+
View
4 examples/dannys_example.py
@@ -40,8 +40,8 @@
pylab.yticks((0, 0.5, 1), ('0', '.5', '1'), color = 'k', size = 20)
## Right Y-axis labels
-pylab.text(1.05, 0.5, r"\bf{level set} $\phi$", {'color' : 'g', 'fontsize' : 20},
- horizontalalignment = 'left',
+pylab.text(1.05, 0.5, r"\bf{level set} $\phi$", {'color' : 'g', 'fontsize' : 20},
+ horizontalalignment = 'left',
verticalalignment = 'center',
rotation = 90,
clip_on = False)
View
4 examples/data_helper.py
@@ -28,7 +28,7 @@ def get_daily_data():
open, high, low, close, volume
as numeric arrays
-
+
"""
class C: pass
@@ -37,7 +37,7 @@ def get_ticker(ticker):
lines = file( 'data/%s.csv' % ticker ).readlines()
for line in lines[1:]:
vals.append([float(val) for val in line.split(',')[1:]])
-
+
M = array(vals)
c = C()
c.open = M[:,0]
View
2 examples/date_demo_convert.py
@@ -9,7 +9,7 @@
date2 = datetime.datetime( 2000, 3, 6)
delta = datetime.timedelta(hours=6)
dates = drange(date1, date2, delta)
-
+
y = nx.arange( len(dates)*1.0)
fig = figure()
View
14 examples/dynamic_demo_wx.py
@@ -1,7 +1,7 @@
#!/usr/bin/env python
"""
Copyright (C) Jeremy O'Donoghue, 2003
-
+
License: This work is licensed under the PSF. A copy should be included
with this source code, and is also available at
http://www.python.org/psf/license.html
@@ -96,7 +96,7 @@ def __init__(self):
self.SetSizer(sizer)
self.Fit()
EVT_TIMER(self, TIMER_ID, self.onTimer)
-
+
def init_plot_data(self):
a = self.fig.add_subplot(111)
self.ind = numpy.arange(60)
@@ -108,26 +108,26 @@ def init_plot_data(self):
self.count = 0
def GetToolBar(self):
- # You will need to override GetToolBar if you are using an
+ # You will need to override GetToolBar if you are using an
# unmanaged toolbar in your frame
return self.toolbar
-
+
def onTimer(self, evt):
self.count += 1
if self.count >= 60: self.count = 0
self.lines[0].set_data(self.ind, self.X[:,self.count])
self.canvas.draw()
self.canvas.gui_repaint()
-
+
if __name__ == '__main__':
app = wxPySimpleApp()
frame = PlotFigure()
frame.init_plot_data()
-
+
# Initialise the timer - wxPython requires this to be connected to the
# receivicng event handler
t = wxTimer(frame, TIMER_ID)
t.Start(100)
-
+
frame.Show()
app.MainLoop()
View
2 examples/dynamic_image_wxagg.py
@@ -95,7 +95,7 @@ def onTimer(self, evt):
self.im.set_array(z)
self.canvas.draw()
#self.canvas.gui_repaint() # jdh wxagg_draw calls this already
-
+
def onClose(self, evt):
self.t.Stop()
evt.Skip()
View
14 examples/dynamic_image_wxagg2.py
@@ -1,7 +1,7 @@
#!/usr/bin/env python
"""
Copyright (C) 2003-2005 Jeremy O'Donoghue and others
-
+
License: This work is licensed under the PSF. A copy should be included
with this source code, and is also available at
http://www.python.org/psf/license.html
@@ -81,32 +81,32 @@ def init_plot_data(self):
self.fig.colorbar(self.im,cax=cax,orientation='vertical')
def GetToolBar(self):
- # You will need to override GetToolBar if you are using an
+ # You will need to override GetToolBar if you are using an
# unmanaged toolbar in your frame
return self.toolbar
-
+
def onTimer(self, evt):
self.x += numerix.pi/15
self.y += numerix.pi/20
z = numerix.sin(self.x) + numerix.cos(self.y)
self.im.set_array(z)
self.canvas.draw()
#self.canvas.gui_repaint() # jdh wxagg_draw calls this already
-
+
def onEraseBackground(self, evt):
# this is supposed to prevent redraw flicker on some X servers...
pass
-
+
if __name__ == '__main__':
app = wxPySimpleApp()
frame = PlotFigure()
frame.init_plot_data()
-
+
# Initialise the timer - wxPython requires this to be connected to
# the receiving event handler
t = wxTimer(frame, TIMER_ID)
t.Start(200)
-
+
frame.Show()
app.MainLoop()
View
2 examples/embedding_in_qt.py
@@ -37,7 +37,7 @@ def __init__(self, parent=None, width=5, height=4, dpi=100):
self.axes.hold(False)
self.compute_initial_figure()
-
+
FigureCanvas.__init__(self, self.fig)
self.reparent(parent, QPoint(0, 0))
View
6 examples/embedding_in_qt4.py
@@ -29,7 +29,7 @@ def __init__(self, parent=None, width=5, height=4, dpi=100):
self.axes.hold(False)
self.compute_initial_figure()
-
+
FigureCanvas.__init__(self, self.fig)
self.setParent(parent)
@@ -80,7 +80,7 @@ def __init__(self):
self.setWindowTitle("application main window")
self.file_menu = QtGui.QMenu('&File', self)
- self.file_menu.addAction('&Quit', self.fileQuit,
+ self.file_menu.addAction('&Quit', self.fileQuit,
QtCore.Qt.CTRL + QtCore.Qt.Key_Q)
self.menuBar().addMenu(self.file_menu)
@@ -127,7 +127,7 @@ def main():
# allocation strategy.
QtGui.QApplication.setColorSpec(QtGui.QApplication.NormalColor)
qApp = QtGui.QApplication(sys.argv)
-
+
aw = ApplicationWindow()
aw.setWindowTitle("%s" % progname)
aw.show()
View
22 examples/embedding_in_wx.py
@@ -1,10 +1,10 @@
#!/usr/bin/env python
# embedding_in_wx.py
-#
+#
"""
Copyright (C) Jeremy O'Donoghue, 2003
-
+
License: This work is licensed under the PSF. A copy should be included
with this source code, and is also available at
http://www.python.org/psf/license.html
@@ -16,23 +16,23 @@
save figures in the supported formats.
There are a few small complexities worth noting in the example:
-
+
1) By default, a wxFrame can contain a toolbar (added with SetToolBar())
but this is at the top of the frame. Matplotlib default is to put the
controls at the bottom of the frame, so you have to manage the toolbar
yourself. I have done this by putting the figure and toolbar into a
sizer, but this means that you need to override GetToolBar for your
wxFrame so that the figure manager can find the toolbar.
-
+
2) I have implemented a figure manager to look after the plots and axes.
If you don't want a toolbar, it is simpler to add the figure directly
and not worry. However, the figure manager looks after clipping of the
figure contents, so you will need it if you want to navigate
-
+
3) There is a bug in the way in which my copy of wxPython calculates
toolbar width on Win32, so there is a tricky line to ensure that the
width of the toolbat is the same as the width of the figure.
-
+
4) Depending on the parameters you pass to the sizer, you can make the
figure resizable or not.
"""
@@ -48,7 +48,7 @@
from wxPython.wx import *
-
+
class PlotFigure(wxFrame):
def __init__(self):
wxFrame.__init__(self, None, -1, "Test embedded wxFigure")
@@ -78,10 +78,10 @@ def __init__(self):
def plot_data(self):
# Use ths line if using a toolbar
a = self.fig.add_subplot(111)
-
+
# Or this one if there is no toolbar
#a = Subplot(self.fig, 111)
-
+
t = numpy.arange(0.0,3.0,0.01)
s = numpy.sin(2*numpy.pi*t)
c = numpy.cos(2*numpy.pi*t)
@@ -90,10 +90,10 @@ def plot_data(self):
self.toolbar.update()
def GetToolBar(self):
- # You will need to override GetToolBar if you are using an
+ # You will need to override GetToolBar if you are using an
# unmanaged toolbar in your frame
return self.toolbar
-
+
if __name__ == '__main__':
app = wxPySimpleApp(0)
frame = PlotFigure()
View
12 examples/embedding_in_wx2.py
@@ -22,7 +22,7 @@
from wxPython.wx import *
class CanvasFrame(wxFrame):
-
+
def __init__(self):
wxFrame.__init__(self,None,-1,
'CanvasFrame',size=(550,350))
@@ -33,7 +33,7 @@ def __init__(self):
self.axes = self.figure.add_subplot(111)
t = arange(0.0,3.0,0.01)
s = sin(2*pi*t)
-
+
self.axes.plot(t,s)
self.canvas = FigureCanvas(self, -1, self.figure)
@@ -64,14 +64,14 @@ def add_toolbar(self):
self.toolbar.SetSize(wxSize(fw, th))
self.sizer.Add(self.toolbar, 0, wxLEFT | wxEXPAND)
# update the axes menu on the toolbar
- self.toolbar.update()
+ self.toolbar.update()
+
-
def OnPaint(self, event):
self.canvas.draw()
-
+
class App(wxApp):
-
+
def OnInit(self):
'Create the main window and insert the custom frame'
frame = CanvasFrame()
View
28 examples/embedding_in_wx3.py
@@ -1,7 +1,7 @@
#!/usr/bin/env python
"""
Copyright (C) 2003-2004 Andrew Straw, Jeremy O'Donoghue and others
-
+
License: This work is licensed under the PSF. A copy should be included
with this source code, and is also available at
http://www.python.org/psf/license.html
@@ -22,7 +22,7 @@
import matplotlib
matplotlib.use('WXAgg')
# some of this code is numarray dependent
-matplotlib.rcParams['numerix'] = 'numarray'
+matplotlib.rcParams['numerix'] = 'numarray'
import matplotlib.cm as cm
from matplotlib.backends.backend_wxagg import Toolbar, FigureCanvasWxAgg
from matplotlib.figure import Figure
@@ -60,15 +60,15 @@ def __init__(self, parent):
def init_plot_data(self):
a = self.fig.add_subplot(111)
-
+
x = numerix.arange(120.0)*2*numerix.pi/60.0
y = numerix.arange(100.0)*2*numerix.pi/50.0
self.x, self.y = meshgrid(x, y)
z = numerix.sin(self.x) + numerix.cos(self.y)
self.im = a.imshow( z, cmap=cm.jet)#, interpolation='nearest')
-
+
zmax = mlab.max(mlab.max(z))-ERR_TOL
-
+
ymax_i, xmax_i = numerix.nonzero(
numerix.greater_equal(z, zmax))
if self.im.origin == 'upper':
@@ -78,10 +78,10 @@ def init_plot_data(self):
self.toolbar.update() # Not sure why this is needed - ADS
def GetToolBar(self):
- # You will need to override GetToolBar if you are using an
+ # You will need to override GetToolBar if you are using an
# unmanaged toolbar in your frame
return self.toolbar
-
+
def OnWhiz(self,evt):
self.x += numerix.pi/15
self.y += numerix.pi/20
@@ -96,7 +96,7 @@ def OnWhiz(self,evt):
self.lines[0].set_data(xmax_i,ymax_i)
self.canvas.draw()
-
+
def onEraseBackground(self, evt):
# this is supposed to prevent redraw flicker on some X servers...
pass
@@ -116,7 +116,7 @@ def OnInit(self):
# panel for our panel so I know where it'll go when in XRCed.)
plot_container = XRCCTRL(self.frame,"plot_container_panel")
sizer = wxBoxSizer(wxVERTICAL)
-
+
# matplotlib panel itself
self.plotpanel = PlotPanel(plot_container)
self.plotpanel.init_plot_data()
@@ -130,28 +130,28 @@ def OnInit(self):
whiz_button = XRCCTRL(self.frame,"whiz_button")
EVT_BUTTON(whiz_button, whiz_button.GetId(),
self.plotpanel.OnWhiz)
-
+
# bang button ------------------
bang_button = XRCCTRL(self.frame,"bang_button")
EVT_BUTTON(bang_button, bang_button.GetId(),
self.OnBang)
-
+
# final setup ------------------
-
+
sizer = self.panel.GetSizer()
self.frame.Show(1)
self.SetTopWindow(self.frame)
return True
-
+
def OnBang(self,event):
bang_count = XRCCTRL(self.frame,"bang_count")
bangs = bang_count.GetValue()
bangs = int(bangs)+1
bang_count.SetValue(str(bangs))
-
+
if __name__ == '__main__':
app = MyApp(0)
app.MainLoop()
View
16 examples/embedding_in_wx4.py
@@ -15,7 +15,7 @@
# comment out the following to use wx rather than wxagg
matplotlib.use('WXAgg')
from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FigureCanvas
-from matplotlib.backends.backend_wxagg import NavigationToolbar2WxAgg
+from matplotlib.backends.backend_wxagg import NavigationToolbar2WxAgg
from matplotlib.backends.backend_wx import _load_bitmap
from matplotlib.figure import Figure
@@ -57,7 +57,7 @@ def _on_custom(self, evt):
class CanvasFrame(wxFrame):
-
+
def __init__(self):
wxFrame.__init__(self,None,-1,
'CanvasFrame',size=(550,350))
@@ -68,15 +68,15 @@ def __init__(self):
self.axes = self.figure.add_subplot(111)
t = arange(0.0,3.0,0.01)
s = sin(2*pi*t)
-
+
self.axes.plot(t,s)
self.canvas = FigureCanvas(self, -1, self.figure)
self.sizer = wxBoxSizer(wxVERTICAL)
self.sizer.Add(self.canvas, 1, wxTOP | wxLEFT | wxEXPAND)
- # Capture the paint message
- EVT_PAINT(self, self.OnPaint)
+ # Capture the paint message
+ EVT_PAINT(self, self.OnPaint)
self.toolbar = MyNavigationToolbar(self.canvas, True)
self.toolbar.Realize()
@@ -97,17 +97,17 @@ def __init__(self):
self.sizer.Add(self.toolbar, 0, wxLEFT | wxEXPAND)
# update the axes menu on the toolbar
- self.toolbar.update()
+ self.toolbar.update()
self.SetSizer(self.sizer)
self.Fit()
def OnPaint(self, event):
self.canvas.draw()
event.Skip()
-
+
class App(wxApp):
-
+
def OnInit(self):
'Create the main window and insert the custom frame'
frame = CanvasFrame()
View
2 examples/errorbar_demo.py
@@ -8,7 +8,7 @@
g = 2*e
h = 2*f
-figure()
+figure()
errorbar(t, s, e, fmt='o') # vertical symmetric
figure()
View
4 examples/figimage_demo.py
@@ -10,11 +10,11 @@
Z = arange(10000.0); Z.shape = 100,100
Z[:,50:] = 1
jet() # sets the default
-im1 = figimage(Z, xo=50, yo=0)
+im1 = figimage(Z, xo=50, yo=0)
im2 = figimage(Z, xo=100, yo=100, alpha=.8)
#gray() # overrides current and sets default
#savefig('figimage_demo')
show()
-
+
View
4 examples/fill_between.py
@@ -9,7 +9,7 @@
# reverse x and y2 so the polygon fills in order
x = concatenate( (x1,x1[::-1]) )
y = concatenate( (y1,y2[::-1]) )
-
+
p = fill(x, y, facecolor='g', alpha=0.5)
show()
-
+
View
2 examples/font_indexing.py
@@ -16,7 +16,7 @@
codes = font.get_charmap().items()
#dsu = [(ccode, glyphind) for ccode, glyphind in codes]
#dsu.sort()
-#for ccode, glyphind in dsu:
+#for ccode, glyphind in dsu:
# try: name = font.get_glyph_name(glyphind)
# except RuntimeError: pass
# else: print '% 4d % 4d %s %s'%(glyphind, ccode, hex(int(ccode)), name)
View
4 examples/fonts_demo_kw.py
@@ -20,7 +20,7 @@
for k in range(5):
if k == 2:
t = text(-0.8, yp[k], family[k], family=family[k],
- name='Script MT', **alignment)
+ name='Script MT', **alignment)
else:
t = text(-0.8, yp[k], family[k], family=family[k], **alignment)
@@ -68,7 +68,7 @@
x = 0
### Show bold italic
t = text(x, 0.1, 'bold italic', style='italic',
- weight='bold', size='x-small',
+ weight='bold', size='x-small',
**alignment)
t = text(x, 0.2, 'bold italic',
View
46 examples/ftface_props.py
@@ -15,19 +15,19 @@
font = FT2Font(fname)
# these constants are used to access the style_flags and face_flags
-FT_FACE_FLAG_SCALABLE = 1 << 0
-FT_FACE_FLAG_FIXED_SIZES = 1 << 1
-FT_FACE_FLAG_FIXED_WIDTH = 1 << 2
-FT_FACE_FLAG_SFNT = 1 << 3
-FT_FACE_FLAG_HORIZONTAL = 1 << 4
-FT_FACE_FLAG_VERTICAL = 1 << 5
-FT_FACE_FLAG_KERNING = 1 << 6
-FT_FACE_FLAG_FAST_GLYPHS = 1 << 7
-FT_FACE_FLAG_MULTIPLE_MASTERS = 1 << 8
-FT_FACE_FLAG_GLYPH_NAMES = 1 << 9
-FT_FACE_FLAG_EXTERNAL_STREAM = 1 << 10
-FT_STYLE_FLAG_ITALIC = 1 << 0
-FT_STYLE_FLAG_BOLD = 1 << 1
+FT_FACE_FLAG_SCALABLE = 1 << 0
+FT_FACE_FLAG_FIXED_SIZES = 1 << 1
+FT_FACE_FLAG_FIXED_WIDTH = 1 << 2
+FT_FACE_FLAG_SFNT = 1 << 3
+FT_FACE_FLAG_HORIZONTAL = 1 << 4
+FT_FACE_FLAG_VERTICAL = 1 << 5
+FT_FACE_FLAG_KERNING = 1 << 6
+FT_FACE_FLAG_FAST_GLYPHS = 1 << 7
+FT_FACE_FLAG_MULTIPLE_MASTERS = 1 << 8
+FT_FACE_FLAG_GLYPH_NAMES = 1 << 9
+FT_FACE_FLAG_EXTERNAL_STREAM = 1 << 10
+FT_STYLE_FLAG_ITALIC = 1 << 0
+FT_STYLE_FLAG_BOLD = 1 << 1
print 'Num faces :', font.num_faces # number of faces in file
print 'Num glyphs :', font.num_glyphs # number of glyphs in the face
@@ -39,28 +39,28 @@
# the following are only available if face.scalable
if font.scalable:
# the face global bounding box (xmin, ymin, xmax, ymax)
- print 'Bbox :', font.bbox
+ print 'Bbox :', font.bbox
# number of font units covered by the EM
- print 'EM :', font.units_per_EM
+ print 'EM :', font.units_per_EM
# the ascender in 26.6 units
- print 'Ascender :', font.ascender
+ print 'Ascender :', font.ascender
# the descender in 26.6 units
- print 'Descender :', font.descender
+ print 'Descender :', font.descender
# the height in 26.6 units
- print 'Height :', font.height
+ print 'Height :', font.height
# maximum horizontal cursor advance
- print 'Max adv width :', font.max_advance_width
+ print 'Max adv width :', font.max_advance_width
# same for vertical layout
- print 'Max adv height :', font.max_advance_height
+ print 'Max adv height :', font.max_advance_height
# vertical position of the underline bar
- print 'Underline pos :', font.underline_position
+ print 'Underline pos :', font.underline_position
# vertical thickness of the underline
- print 'Underline thickness :', font.underline_thickness
+ print 'Underline thickness :', font.underline_thickness
print 'Italics :', font.style_flags & FT_STYLE_FLAG_ITALIC != 0
print 'Bold :', font.style_flags & FT_STYLE_FLAG_BOLD != 0
print 'Scalable :', font.style_flags & FT_FACE_FLAG_SCALABLE != 0
-print 'Fixed sizes :', font.style_flags & FT_FACE_FLAG_FIXED_SIZES != 0
+print 'Fixed sizes :', font.style_flags & FT_FACE_FLAG_FIXED_SIZES != 0
print 'Fixed width :', font.style_flags & FT_FACE_FLAG_FIXED_WIDTH != 0
print 'SFNT :', font.style_flags & FT_FACE_FLAG_SFNT != 0
print 'Horizontal :', font.style_flags & FT_FACE_FLAG_HORIZONTAL != 0
View
4 examples/gtk_spreadsheet.py
@@ -17,7 +17,7 @@
#from matplotlib.numerix import rand
from matplotlib.numerix.random_array import random
from matplotlib.figure import Figure
-
+
class DataManager(gtk.Window):
numRows, numCols = 20,10
@@ -90,7 +90,7 @@ def create_model(self):
for row in self.data:
store.append(row)
return store
-
+
manager = DataManager()
manager.show_all()
View
4 examples/image_interp.py
@@ -19,11 +19,11 @@
with colors a-y as below
- a b c d e
+ a b c d e
f g h i j
k l m n o
p q r s t
- u v w x y
+ u v w x y
the _image module creates the padded array,
View
10 examples/interactive.py
@@ -54,7 +54,7 @@ def __init__(self,on_kill=None,*args,**kw):
self.completer = rlcompleter.Completer(self.locals)
except: # simpler for py2.2
self.completer = rlcompleter.Completer()
-
+
readline.set_completer(self.completer.complete)
# Use tab for completions
readline.parse_and_bind('tab: complete')
@@ -146,7 +146,7 @@ class GTKInterpreter(threading.Thread):
GTK timeout callback.
"""
TIMEOUT = 100 # Millisecond interval between timeouts.
-
+
def __init__(self,banner=None):
threading.Thread.__init__(self)
self.banner = banner
@@ -173,7 +173,7 @@ def pre_interact(self):
It gets called right before interact(), but after the thread starts.
Typically used to push initialization code into the interpreter"""
-
+
pass
class MatplotLibInterpreter(GTKInterpreter):
@@ -188,7 +188,7 @@ def __init__(self,banner=None):
help(plotting) -> help on plotting commands.
"""
GTKInterpreter.__init__(self,banner)
-
+
def pre_interact(self):
"""Initialize matplotlib before user interaction begins"""
@@ -201,7 +201,7 @@ def pre_interact(self):
"from matplotlib.pylab import *\n"]
map(push,lines)
-
+
# Execute file if given.
if len(sys.argv)>1:
import matplotlib
View
12 examples/interactive2.py
@@ -294,7 +294,7 @@ def execute_line(self, line=None):
self.write_line("\n")
else:
self.write_line(line + "\n")
-
+
more = self.push(line)
@@ -307,7 +307,7 @@ def execute_line(self, line=None):
self.current_history = 0
-
+
self.window.raise_()
return gtk.TRUE
@@ -342,10 +342,10 @@ def main():
console = GTKInterpreterConsole()
console.set_size_request(640,480)
w.add(console)
-
+
def destroy(arg=None):
gtk.main_quit()
-
+
def key_event(widget,event):
if gtk.gdk.keyval_name( event.keyval) == 'd' and \
event.state & gtk.gdk.CONTROL_MASK:
@@ -359,7 +359,7 @@ def key_event(widget,event):
w.show_all()
console.execute_line('import matplotlib')
- console.execute_line("matplotlib.use('GTKAgg')")
+ console.execute_line("matplotlib.use('GTKAgg')")
console.execute_line('matplotlib.interactive(1)')
console.execute_line('from pylab import *')
@@ -370,7 +370,7 @@ def key_event(widget,event):
print >> sys.stderr, '%s does not exist' % fname
for line in file(fname):
line = line.strip()
-
+
console.execute_line(line)
gtk.main()
View
2 examples/interp_demo.py
@@ -1,6 +1,6 @@
from pylab import figure, show, nx, linspace, stineman_interp
x = linspace(0,2*nx.pi,20);
-y = nx.sin(x); yp = None
+y = nx.sin(x); yp = None
xi = linspace(x[0],x[-1],100);
yi = stineman_interp(xi,x,y,yp);
View
2 examples/keypress_demo.py
@@ -13,7 +13,7 @@ def press(event):
if event.key=='g':
grid()
draw()
-
+
connect('key_press_event', press)
title('press g to toggle grid')
View
20 examples/lasso_demo.py
@@ -8,7 +8,7 @@
inside polygon detection routine.
"""
from matplotlib.widgets import Lasso
-import matplotlib.mlab
+import matplotlib.mlab
from matplotlib.nxutils import points_inside_poly
from matplotlib.colors import colorConverter
from matplotlib.collections import RegularPolyCollection
@@ -17,14 +17,14 @@
class Datum:
colorin = colorConverter.to_rgba('red')
- colorout = colorConverter.to_rgba('green')
+ colorout = colorConverter.to_rgba('green')
def __init__(self, x, y, include=False):
self.x = x
self.y = y
if include: self.color = self.colorin
else: self.color = self.colorout
-
-
+
+
class LassoManager:
def __init__(self, ax, data):
self.axes = ax
@@ -45,7 +45,7 @@ def __init__(self, ax, data):
ax.add_collection(self.collection)
self.cid = self.canvas.mpl_connect('button_press_event', self.onpress)
-
+
def callback(self, verts):
#print 'all done', verts
#ind = matplotlib.mlab._inside_poly_deprecated(self.xys, verts)
@@ -54,14 +54,14 @@ def callback(self, verts):
if i in ind:
self.facecolors[i] = Datum.colorin
else:
- self.facecolors[i] = Datum.colorout
+ self.facecolors[i] = Datum.colorout
self.canvas.draw_idle()
self.canvas.widgetlock.release(self.lasso)
del self.lasso
- def onpress(self, event):
- if self.canvas.widgetlock.locked(): return
- if event.inaxes is None: return
+ def onpress(self, event):
+ if self.canvas.widgetlock.locked(): return
+ if event.inaxes is None: return
self.lasso = Lasso(event.inaxes, (event.xdata, event.ydata), self.callback)
# acquire a lock on the widget drawing
self.canvas.widgetlock(self.lasso)
@@ -71,5 +71,5 @@ def onpress(self, event):
fig = figure()
ax = fig.add_subplot(111, xlim=(0,1), ylim=(0,1), autoscale_on=False)
lman = LassoManager(ax, data)
-
+
show()
View
2 examples/layer_images.py
@@ -41,4 +41,4 @@ def func3(x,y):
show()
-
+
View
2 examples/legend_auto.py
@@ -87,5 +87,5 @@ def fig_10():
fn_name = "fig_%d" % fig
fn = globals()[fn_name]
fn()
-
+
show()
View
2 examples/legend_demo2.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Make a legend for specific lines.
+# Make a legend for specific lines.
from pylab import *
t1 = arange(0.0, 2.0, 0.1)
View
2 examples/line_styles.py
@@ -21,6 +21,6 @@
setp(gca(), 'yticklabels', [])
if not gca().is_last_row():
setp(gca(), 'xticklabels', [])
-
+
#savefig('line_styles', dpi=300)
show()
View
2 examples/major_minor_demo1.py
@@ -48,6 +48,6 @@
ax.xaxis.set_major_formatter(majorFormatter)
#for the minor ticks, use no labels; default NullFormatter
-ax.xaxis.set_minor_locator(minorLocator)
+ax.xaxis.set_minor_locator(minorLocator)
show()
View
2 examples/major_minor_demo2.py
@@ -21,6 +21,6 @@
ax.xaxis.set_major_formatter(majorFormatter)
#for the minor ticks, use no labels; default NullFormatter
-ax.xaxis.set_minor_locator(minorLocator)
+ax.xaxis.set_minor_locator(minorLocator)
show()
View
2 examples/mathtext_demo.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
"""
-
+
In order to use mathtext, you must build matplotlib.ft2font. This is
built by default in the windows installer.
View
10 examples/mpl_with_glade.py
@@ -45,7 +45,7 @@ def __init__(self):
self['windowMain'].move(10,10)
self.figure = Figure(figsize=(8,6), dpi=72)
self.axis = self.figure.add_subplot(111)
-
+
t = arange(0.0,3.0,0.01)
s = sin(2*pi*t)
self.axis.plot(t,s)
@@ -56,9 +56,9 @@ def __init__(self):
self.canvas.show()
self.canvas.set_size_request(600, 400)
self.canvas.set_events(
- gtk.gdk.BUTTON_PRESS_MASK |
+ gtk.gdk.BUTTON_PRESS_MASK |
gtk.gdk.KEY_PRESS_MASK |
- gtk.gdk.KEY_RELEASE_MASK
+ gtk.gdk.KEY_RELEASE_MASK
)
self.canvas.set_flags(gtk.HAS_FOCUS|gtk.CAN_FOCUS)
self.canvas.grab_focus()
@@ -69,7 +69,7 @@ def buttonpress(widget, event):
print 'button press'
self.canvas.connect('key_press_event', keypress)
- self.canvas.connect('button_press_event', buttonpress)
+ self.canvas.connect('button_press_event', buttonpress)
def onselect(xmin, xmax):
print xmin, xmax
@@ -80,7 +80,7 @@ def onselect(xmin, xmax):
self['vboxMain'].pack_start(self.canvas, True, True)
self['vboxMain'].show()
-
+
# below is optional if you want the navigation toolbar
self.navToolbar = NavigationToolbar(self.canvas, self['windowMain'])
self.navToolbar.lastDir = '/var/tmp/'
View
16 examples/mri_with_eeg.py
@@ -63,33 +63,33 @@
for i in range(numRows):
# effectively a copy of transData
- trans = get_bbox_transform(boxin, boxout)
+ trans = get_bbox_transform(boxin, boxout)
offset = (i+1)/(numRows+1)
trans.set_offset( (0, offset), transOffset)
-
+
thisLine = Line2D(
t, data[:,i]-data[0,i],
)
-
+
thisLine.set_transform(trans)
-
+
ax.add_line(thisLine)
ticklocs.append(offset)
xlim(0,10)
xticks(arange(10))
- setp(gca(), 'yticklabels', ['PG3', 'PG5', 'PG7', 'PG9'])
+ setp(gca(), 'yticklabels', ['PG3', 'PG5', 'PG7', 'PG9'])
# set the yticks to use axes coords on the y axis
ax.set_yticks(ticklocs)
for tick in ax.yaxis.get_major_ticks():
tick.label1.set_transform(ax.transAxes)
- tick.label2.set_transform(ax.transAxes)
+ tick.label2.set_transform(ax.transAxes)
tick.tick1line.set_transform(ax.transAxes)
- tick.tick2line.set_transform(ax.transAxes)
- tick.gridline.set_transform(ax.transAxes)
+ tick.tick2line.set_transform(ax.transAxes)
+ tick.gridline.set_transform(ax.transAxes)
xlabel('time (s)')
View
2 examples/multiline.py
@@ -8,7 +8,7 @@
text(2, 7,'this is\nyet another test',
rotation=45,
horizontalalignment = 'center',
- verticalalignment = 'top',
+ verticalalignment = 'top',
multialignment = 'center')
#savefig('multiline')
grid(True)
View
2 examples/pcolor_demo.py
@@ -25,4 +25,4 @@ def func3(x,y):
savefig('pcolor_demo')
show()
-
+
View
2 examples/pcolor_demo2.py
@@ -28,4 +28,4 @@ def func3(x,y):
#savefig('pcolor_demo2')
show()
-
+
View
18 examples/pick_event_demo.py
@@ -2,7 +2,7 @@
"""
You can enable picking by setting the"picker" property of an artist
-(eg a matplotlib Line2D, Text, Patch, Polygon, AxesImage,
+(eg a matplotlib Line2D, Text, Patch, Polygon, AxesImage,
etc...)
There are a variety of meanings of the picker property
@@ -12,7 +12,7 @@
boolean - if True then picking will be enabled and the
artist will fire a pick event if the mouse event is over
the artist
-
+
float - if picker is a number it is interpreted as an
epsilon tolerance in points and the the artist will fire
off an event if it's data is within epsilon of the mouse
@@ -41,7 +41,7 @@ def pick_handler(event):
artist = event.artist
# now do something with this...
-
+
The pick event (matplotlib.backend_bases.PickEvent) which is passed to
your callback is always fired with two attributes:
@@ -59,7 +59,7 @@ def pick_handler(event):
attach additional meta data like the indices into the data that meet
the picker criteria (eg all the points in the line that are within the
specified epsilon tolerance)
-
+
The examples below illustrate each of these methods.
"""
@@ -80,7 +80,7 @@ def pick_handler(event):
ax2 = fig.add_subplot(212)
bars = ax2.bar(range(10), nx.mlab.rand(10), picker=True)
- for label in ax2.get_xticklabels(): # make the xtick labels pickable
+ for label in ax2.get_xticklabels(): # make the xtick labels pickable
label.set_picker(True)
@@ -97,7 +97,7 @@ def onpick1(event):
elif isinstance(event.artist, Text):
text = event.artist
print 'onpick1 text:', text.get_text()
-
+