|
From: <md...@us...> - 2007-09-10 17:45:18
|
Revision: 3824
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3824&view=rev
Author: mdboom
Date: 2007-09-10 10:45:15 -0700 (Mon, 10 Sep 2007)
Log Message:
-----------
Merged revisions 3813-3823 via svnmerge from
http://matplotlib.svn.sf.net/svnroot/matplotlib/trunk/matplotlib
........
r3814 | jouni | 2007-09-07 15:45:48 -0400 (Fri, 07 Sep 2007) | 3 lines
In backend_pdf usetex, gather consecutive characters with same x
coordinate and same font into strings.
........
r3815 | mdboom | 2007-09-07 16:28:01 -0400 (Fri, 07 Sep 2007) | 3 lines
Support characters composed of multiple characters. Only one
supported at the moment is AA (angstrom).
........
r3816 | jouni | 2007-09-07 16:43:20 -0400 (Fri, 07 Sep 2007) | 2 lines
Return widths of glyphs to caller
........
r3817 | efiring | 2007-09-08 19:53:06 -0400 (Sat, 08 Sep 2007) | 2 lines
Delete gd and paint backends.
........
r3818 | efiring | 2007-09-08 20:41:17 -0400 (Sat, 08 Sep 2007) | 2 lines
Removed matplotlibrc; it is generated by setup.py.
........
r3819 | efiring | 2007-09-09 18:41:36 -0400 (Sun, 09 Sep 2007) | 2 lines
Factored plotting part of pylab.py into pyplot.py
........
r3820 | efiring | 2007-09-09 21:42:39 -0400 (Sun, 09 Sep 2007) | 2 lines
Numpification and cleanup of examples
........
r3821 | efiring | 2007-09-10 02:55:10 -0400 (Mon, 10 Sep 2007) | 2 lines
Removed obsolete and broken methods from Axes and PolarAxes
........
Modified Paths:
--------------
branches/transforms/API_CHANGES
branches/transforms/CHANGELOG
branches/transforms/boilerplate.py
branches/transforms/examples/animation_blit.py
branches/transforms/examples/animation_blit_fltk.py
branches/transforms/examples/animation_blit_qt.py
branches/transforms/examples/animation_blit_qt4.py
branches/transforms/examples/animation_blit_tk.py
branches/transforms/examples/animation_blit_wx.py
branches/transforms/examples/backend_driver.py
branches/transforms/examples/clippedline.py
branches/transforms/examples/collections_demo.py
branches/transforms/examples/color_by_yvalue.py
branches/transforms/examples/contourf_demo.py
branches/transforms/examples/data_helper.py
branches/transforms/examples/dynamic_demo_wx.py
branches/transforms/examples/dynamic_image_wxagg.py
branches/transforms/examples/dynamic_image_wxagg2.py
branches/transforms/examples/embedding_in_gtk.py
branches/transforms/examples/embedding_in_gtk2.py
branches/transforms/examples/embedding_in_gtk3.py
branches/transforms/examples/embedding_in_qt.py
branches/transforms/examples/embedding_in_qt4.py
branches/transforms/examples/embedding_in_tk.py
branches/transforms/examples/embedding_in_tk2.py
branches/transforms/examples/embedding_in_wx.py
branches/transforms/examples/embedding_in_wx2.py
branches/transforms/examples/embedding_in_wx3.py
branches/transforms/examples/embedding_in_wx4.py
branches/transforms/examples/gtk_spreadsheet.py
branches/transforms/examples/histogram_demo_canvasagg.py
branches/transforms/examples/image_masked.py
branches/transforms/examples/mathtext_wx.py
branches/transforms/examples/mpl_with_glade.py
branches/transforms/examples/multi_image.py
branches/transforms/examples/pcolor_nonuniform.py
branches/transforms/examples/polar_bar.py
branches/transforms/examples/polar_demo.py
branches/transforms/examples/polar_legend.py
branches/transforms/examples/poly_editor.py
branches/transforms/examples/printing_in_wx.py
branches/transforms/examples/pythonic_matplotlib.py
branches/transforms/examples/rc_traits.py
branches/transforms/examples/scatter_masked.py
branches/transforms/examples/strip_chart_demo.py
branches/transforms/examples/tex_demo.py
branches/transforms/examples/tex_unicode_demo.py
branches/transforms/examples/vline_demo.py
branches/transforms/examples/webapp_demo.py
branches/transforms/examples/wxcursor_demo.py
branches/transforms/lib/matplotlib/__init__.py
branches/transforms/lib/matplotlib/axes.py
branches/transforms/lib/matplotlib/backends/__init__.py
branches/transforms/lib/matplotlib/backends/backend_pdf.py
branches/transforms/lib/matplotlib/config/mplconfig.py
branches/transforms/lib/matplotlib/config/rcsetup.py
branches/transforms/lib/matplotlib/dviread.py
branches/transforms/lib/matplotlib/mathtext.py
branches/transforms/lib/matplotlib/mlab.py
branches/transforms/lib/matplotlib/mpl-data/matplotlib.conf
branches/transforms/lib/matplotlib/pylab.py
branches/transforms/setupext.py
Added Paths:
-----------
branches/transforms/lib/matplotlib/pyplot.py
Removed Paths:
-------------
branches/transforms/examples/anim_tk.py
branches/transforms/examples/gdtest.py
branches/transforms/examples/image_demo_na.py
branches/transforms/lib/matplotlib/backends/backend_gd.py
branches/transforms/lib/matplotlib/backends/backend_paint.py
branches/transforms/lib/matplotlib/mpl-data/matplotlibrc
Property Changed:
----------------
branches/transforms/
Property changes on: branches/transforms
___________________________________________________________________
Name: svnmerge-integrated
- /trunk/matplotlib:1-3812
+ /trunk/matplotlib:1-3823
Modified: branches/transforms/API_CHANGES
===================================================================
--- branches/transforms/API_CHANGES 2007-09-10 17:40:47 UTC (rev 3823)
+++ branches/transforms/API_CHANGES 2007-09-10 17:45:15 UTC (rev 3824)
@@ -1,3 +1,5 @@
+ The gd and paint backends have been deleted.
+
The errorbar method and function now accept additional kwargs
so that upper and lower limits can be indicated by capping the
bar with a caret instead of a straight line segment.
Modified: branches/transforms/CHANGELOG
===================================================================
--- branches/transforms/CHANGELOG 2007-09-10 17:40:47 UTC (rev 3823)
+++ branches/transforms/CHANGELOG 2007-09-10 17:45:15 UTC (rev 3824)
@@ -1,3 +1,16 @@
+2007-09-09 Split out the plotting part of pylab and put it in
+ pyplot.py; removed numerix from the remaining pylab.py,
+ which imports everything from pyplot.py. The intention
+ is that apart from cleanups, the result of importing
+ from pylab is nearly unchanged, but there is the
+ new alternative of importing from pyplot to get
+ the state-engine graphics without all the numeric
+ functions.
+ Numpified examples; deleted two that were obsolete;
+ modified some to use pyplot. - EF
+
+2007-09-08 Eliminated gd and paint backends - EF
+
2007-09-06 .bmp file format is now longer an alias for .raw
2007-09-07 Added clip path support to pdf backend. - JKS
@@ -6,17 +19,17 @@
Now it doesn't crash Preview.app. - JKS
2007-09-06 Refactored image saving code so that all GUI backends can
- save most image types. See FILETYPES for a matrix of
- backends and their supported file types.
- Backend canvases should no longer write their own print_figure()
- method -- instead they should write a print_xxx method for
- each filetype they can output and add an entry to their
- class-scoped filetypes dictionary. - MGD
+ save most image types. See FILETYPES for a matrix of
+ backends and their supported file types.
+ Backend canvases should no longer write their own print_figure()
+ method -- instead they should write a print_xxx method for
+ each filetype they can output and add an entry to their
+ class-scoped filetypes dictionary. - MGD
2007-09-05 Fixed Qt version reporting in setupext.py - DSD
2007-09-04 Embedding Type 1 fonts in PDF, and thus usetex support
- via dviread, sort of works. To test, enable it by
+ via dviread, sort of works. To test, enable it by
renaming _draw_tex to draw_tex. - JKS
2007-09-03 Added ability of errorbar show limits via caret or
Modified: branches/transforms/boilerplate.py
===================================================================
--- branches/transforms/boilerplate.py 2007-09-10 17:40:47 UTC (rev 3823)
+++ branches/transforms/boilerplate.py 2007-09-10 17:45:15 UTC (rev 3824)
@@ -29,7 +29,7 @@
return ret
if Axes.%(func)s.__doc__ is not None:
%(func)s.__doc__ = dedent(Axes.%(func)s.__doc__) + \"\"\"
-Addition kwargs: hold = [True|False] overrides default hold state\"\"\"
+Additional kwargs: hold = [True|False] overrides default hold state\"\"\"
"""
_fmtmisc = """\
@@ -74,6 +74,8 @@
'plot',
'plot_date',
'psd',
+ 'quiver',
+ 'quiverkey',
'scatter',
'semilogx',
'semilogy',
@@ -82,8 +84,6 @@
'stem',
'step',
'vlines',
- 'quiver',
- 'quiverkey',
'xcorr',
)
@@ -104,7 +104,6 @@
'pcolormesh' : 'gci._current = ret',
'imshow' : 'gci._current = ret',
'spy' : 'gci._current = ret',
- 'quiver2' : 'gci._current = ret',
'quiver' : 'gci._current = ret',
'specgram' : 'gci._current = ret[-1]',
@@ -129,11 +128,13 @@
# This function was autogenerated by boilerplate.py. Do not edit as
# changes will be lost
def %(name)s():
- 'set the default colormap to %(name)s and apply to current image if any. See help(colormaps) for more information'
+ '''
+ set the default colormap to %(name)s and apply to current image if any.
+ See help(colormaps) for more information
+ '''
rc('image', cmap='%(name)s')
im = gci()
-
if im is not None:
im.set_cmap(cm.%(name)s)
draw_if_interactive()
Deleted: branches/transforms/examples/anim_tk.py
===================================================================
--- branches/transforms/examples/anim_tk.py 2007-09-10 17:40:47 UTC (rev 3823)
+++ branches/transforms/examples/anim_tk.py 2007-09-10 17:45:15 UTC (rev 3824)
@@ -1,49 +0,0 @@
-# deprecated - this example is no longer needed. Follow the model of
-# anim.py to use interaction = True to avoid all the cruft of timers,
-# callbacks and the likes used here
-
-#!/usr/bin/env python2.3
-
-import matplotlib
-matplotlib.use('TkAgg')
-import pylab
-
-#import Tkinter as Tk
-import matplotlib.numerix as numerix
-fig = pylab.figure(1)
-ind = numerix.arange(60)
-
-
-
-x_tmp=[]
-for i in range(100):
- x_tmp.append(numerix.sin((ind+i)*numerix.pi/15.0))
-
-X=numerix.array(x_tmp)
-
-
-lines = pylab.plot(X[:,0],'o')
-
-manager = pylab.get_current_fig_manager()
-
-def updatefig(*args):
- updatefig.count += 1
- lines[0].set_ydata(X[:,updatefig.count%60])
- manager.canvas.draw()
- return updatefig.count
-updatefig.count=-1
-
-def run(*args):
- print 'called run'
-
- import time
- tstart = time.time()
- while 1:
- cnt = updatefig()
- if cnt==100: break
- print 'elapsed', 100.0/(time.time() - tstart)
-
-import Tkinter as Tk
-manager.window.after(10, run)
-manager.show()
-Tk.mainloop()
Modified: branches/transforms/examples/animation_blit.py
===================================================================
--- branches/transforms/examples/animation_blit.py 2007-09-10 17:40:47 UTC (rev 3823)
+++ branches/transforms/examples/animation_blit.py 2007-09-10 17:45:15 UTC (rev 3824)
@@ -10,7 +10,7 @@
import matplotlib
matplotlib.use('GTKAgg')
-import matplotlib.numerix as nx
+import numpy as npy
import pylab as p
@@ -21,8 +21,8 @@
p.grid() # to ensure proper background restore
# create the initial line
-x = nx.arange(0,2*nx.pi,0.01)
-line, = p.plot(x, nx.sin(x), animated=True, lw=2)
+x = npy.arange(0,2*npy.pi,0.01)
+line, = p.plot(x, npy.sin(x), animated=True, lw=2)
# for profiling
tstart = time.time()
@@ -34,7 +34,7 @@
# 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(npy.sin(x+update_line.cnt/10.0))
# just draw the animated artist
try:
ax.draw_artist(line)
Modified: branches/transforms/examples/animation_blit_fltk.py
===================================================================
--- branches/transforms/examples/animation_blit_fltk.py 2007-09-10 17:40:47 UTC (rev 3823)
+++ branches/transforms/examples/animation_blit_fltk.py 2007-09-10 17:45:15 UTC (rev 3824)
@@ -3,7 +3,7 @@
import matplotlib
matplotlib.use('FltkAgg')
import pylab as p
-import matplotlib.numerix as nx
+import numpy as nx
import time
Modified: branches/transforms/examples/animation_blit_qt.py
===================================================================
--- branches/transforms/examples/animation_blit_qt.py 2007-09-10 17:40:47 UTC (rev 3823)
+++ branches/transforms/examples/animation_blit_qt.py 2007-09-10 17:45:15 UTC (rev 3824)
@@ -15,7 +15,7 @@
ITERS = 1000
import pylab as p
-import matplotlib.numerix as nx
+import numpy as npy
import time
class BlitQT(QObject):
@@ -27,8 +27,8 @@
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.x = npy.arange(0,2*npy.pi,0.01)
+ self.line, = p.plot(self.x, npy.sin(self.x), animated=True, lw=2)
self.background = None
@@ -39,7 +39,7 @@
# 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(npy.sin(self.x+self.cnt/10.0))
# just draw the animated artist
self.ax.draw_artist(self.line)
# just redraw the axes rectangle
Modified: branches/transforms/examples/animation_blit_qt4.py
===================================================================
--- branches/transforms/examples/animation_blit_qt4.py 2007-09-10 17:40:47 UTC (rev 3823)
+++ branches/transforms/examples/animation_blit_qt4.py 2007-09-10 17:45:15 UTC (rev 3824)
@@ -10,7 +10,7 @@
ITERS = 1000
import pylab as p
-import matplotlib.numerix as nx
+import numpy as npy
import time
class BlitQT(QtCore.QObject):
@@ -22,8 +22,8 @@
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.x = npy.arange(0,2*npy.pi,0.01)
+ self.line, = p.plot(self.x, npy.sin(self.x), animated=True, lw=2)
self.background = None
@@ -34,7 +34,7 @@
# 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(npy.sin(self.x+self.cnt/10.0))
# just draw the animated artist
self.ax.draw_artist(self.line)
# just redraw the axes rectangle
Modified: branches/transforms/examples/animation_blit_tk.py
===================================================================
--- branches/transforms/examples/animation_blit_tk.py 2007-09-10 17:40:47 UTC (rev 3823)
+++ branches/transforms/examples/animation_blit_tk.py 2007-09-10 17:45:15 UTC (rev 3824)
@@ -6,7 +6,7 @@
import sys
import pylab as p
-import matplotlib.numerix as nx
+import numpy as npy
import time
ax = p.subplot(111)
@@ -14,8 +14,8 @@
# create the initial line
-x = nx.arange(0,2*nx.pi,0.01)
-line, = p.plot(x, nx.sin(x), animated=True, lw=2)
+x = npy.arange(0,2*npy.pi,0.01)
+line, = p.plot(x, npy.sin(x), animated=True, lw=2)
def run(*args):
background = canvas.copy_from_bbox(ax.bbox)
@@ -26,7 +26,7 @@
# 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(npy.sin(x+run.cnt/10.0))
# just draw the animated artist
ax.draw_artist(line)
# just redraw the axes rectangle
Modified: branches/transforms/examples/animation_blit_wx.py
===================================================================
--- branches/transforms/examples/animation_blit_wx.py 2007-09-10 17:40:47 UTC (rev 3823)
+++ branches/transforms/examples/animation_blit_wx.py 2007-09-10 17:45:15 UTC (rev 3824)
@@ -12,7 +12,7 @@
import wx
import sys
import pylab as p
-import matplotlib.numerix as nx
+import numpy as npy
import time
@@ -30,8 +30,8 @@
p.grid() # to ensure proper background restore
# create the initial line
-x = nx.arange(0,2*nx.pi,0.01)
-line, = p.plot(x, nx.sin(x), animated=True, lw=2)
+x = npy.arange(0,2*npy.pi,0.01)
+line, = p.plot(x, npy.sin(x), animated=True, lw=2)
# for profiling
tstart = time.time()
@@ -46,7 +46,7 @@
# 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(npy.sin(x+update_line.cnt/10.0))
# just draw the animated artist
ax.draw_artist(line)
# just redraw the axes rectangle
Modified: branches/transforms/examples/backend_driver.py
===================================================================
--- branches/transforms/examples/backend_driver.py 2007-09-10 17:40:47 UTC (rev 3823)
+++ branches/transforms/examples/backend_driver.py 2007-09-10 17:45:15 UTC (rev 3824)
@@ -42,7 +42,6 @@
'histogram_demo.py',
'image_demo.py',
'image_demo2.py',
- 'image_demo_na.py',
'image_masked.py',
'image_origin.py',
'invert_axes.py',
@@ -158,7 +157,7 @@
if __name__ == '__main__':
times = {}
- default_backends = ['Agg', 'PS', 'SVG', 'Template']
+ default_backends = ['Agg', 'PS', 'SVG', 'PDF', 'Template']
if sys.platform == 'win32':
python = r'c:\Python24\python.exe'
else:
Modified: branches/transforms/examples/clippedline.py
===================================================================
--- branches/transforms/examples/clippedline.py 2007-09-10 17:40:47 UTC (rev 3823)
+++ branches/transforms/examples/clippedline.py 2007-09-10 17:45:15 UTC (rev 3824)
@@ -4,7 +4,7 @@
"""
from matplotlib.lines import Line2D
-import matplotlib.numerix as nx
+import numpy as npy
from pylab import figure, show
class ClippedLine(Line2D):
@@ -19,13 +19,13 @@
def set_data(self, *args, **kwargs):
Line2D.set_data(self, *args, **kwargs)
- self.xorig = nx.array(self._x)
- self.yorig = nx.array(self._y)
+ self.xorig = npy.array(self._x)
+ self.yorig = npy.array(self._y)
def draw(self, renderer):
xlim = self.ax.get_xlim()
- ind0, ind1 = nx.searchsorted(self.xorig, xlim)
+ ind0, ind1 = npy.searchsorted(self.xorig, xlim)
self._x = self.xorig[ind0:ind1]
self._y = self.yorig[ind0:ind1]
N = len(self._x)
@@ -43,8 +43,8 @@
fig = figure()
ax = fig.add_subplot(111, autoscale_on=False)
-t = nx.arange(0.0, 100.0, 0.01)
-s = nx.sin(2*nx.pi*t)
+t = npy.arange(0.0, 100.0, 0.01)
+s = npy.sin(2*npy.pi*t)
line = ClippedLine(ax, t, s, color='g', ls='-', lw=2)
ax.add_line(line)
ax.set_xlim(10,30)
Modified: branches/transforms/examples/collections_demo.py
===================================================================
--- branches/transforms/examples/collections_demo.py 2007-09-10 17:40:47 UTC (rev 3823)
+++ branches/transforms/examples/collections_demo.py 2007-09-10 17:45:15 UTC (rev 3824)
@@ -17,10 +17,10 @@
'''
-import pylab as P
+import matplotlib.pyplot as P
from matplotlib import collections, axes, transforms
from matplotlib.colors import colorConverter
-import matplotlib.numerix as N
+import numpy as N
nverts = 50
npts = 100
@@ -33,8 +33,8 @@
spiral = zip(xx,yy)
# Make some offsets
-xo = P.randn(npts)
-yo = P.randn(npts)
+xo = N.random.randn(npts)
+yo = N.random.randn(npts)
xyo = zip(xo, yo)
# Make a list of colors cycling through the rgbcmyk series.
@@ -90,7 +90,7 @@
a = fig.add_subplot(2,2,3)
col = collections.RegularPolyCollection(fig.dpi, 7,
- sizes = P.fabs(xx)*10, offsets=xyo,
+ sizes = N.fabs(xx)*10, offsets=xyo,
transOffset=a.transData)
a.add_collection(col, autolim=True)
trans = transforms.scale_transform(fig.dpi/transforms.Value(72.),
@@ -111,12 +111,12 @@
ncurves = 20
offs = (0.1, 0.0)
-yy = P.linspace(0, 2*N.pi, nverts)
-ym = P.amax(yy)
+yy = N.linspace(0, 2*N.pi, nverts)
+ym = N.amax(yy)
xx = (0.2 + (ym-yy)/ym)**2 * N.cos(yy-0.4) * 0.5
segs = []
for i in range(ncurves):
- xxx = xx + 0.02*P.randn(nverts)
+ xxx = xx + 0.02*N.random.randn(nverts)
curve = zip(xxx, yy*100)
segs.append(curve)
Modified: branches/transforms/examples/color_by_yvalue.py
===================================================================
--- branches/transforms/examples/color_by_yvalue.py 2007-09-10 17:40:47 UTC (rev 3823)
+++ branches/transforms/examples/color_by_yvalue.py 2007-09-10 17:45:15 UTC (rev 3824)
@@ -1,7 +1,7 @@
# use masked arrays to plot a line with different colors by y-value
-import matplotlib.numerix.ma as ma
-from matplotlib.numerix import logical_or
-from pylab import plot, show, arange, sin, pi
+import matplotlib.numerix.npyma as ma
+from numpy import logical_or, arange, sin, pi
+from matplotlib.pyplot import plot, show
t = arange(0.0, 2.0, 0.01)
s = sin(2*pi*t)
Modified: branches/transforms/examples/contourf_demo.py
===================================================================
--- branches/transforms/examples/contourf_demo.py 2007-09-10 17:40:47 UTC (rev 3823)
+++ branches/transforms/examples/contourf_demo.py 2007-09-10 17:45:15 UTC (rev 3824)
@@ -1,6 +1,6 @@
#!/usr/bin/env python
from pylab import *
-import matplotlib.numerix.ma as ma
+import matplotlib.numerix.npyma as ma
origin = 'lower'
#origin = 'upper'
Modified: branches/transforms/examples/data_helper.py
===================================================================
--- branches/transforms/examples/data_helper.py 2007-09-10 17:40:47 UTC (rev 3823)
+++ branches/transforms/examples/data_helper.py 2007-09-10 17:45:15 UTC (rev 3824)
@@ -1,7 +1,8 @@
#!/usr/bin/env python
# Some functions to load a return data for the plot demos
-from matplotlib.numerix import fromstring, argsort, take, array, resize
+from numpy import fromstring, argsort, take, array, resize
+
def get_two_stock_data():
"""
load stock time and price data for two stocks The return values
Modified: branches/transforms/examples/dynamic_demo_wx.py
===================================================================
--- branches/transforms/examples/dynamic_demo_wx.py 2007-09-10 17:40:47 UTC (rev 3823)
+++ branches/transforms/examples/dynamic_demo_wx.py 2007-09-10 17:45:15 UTC (rev 3824)
@@ -63,7 +63,7 @@
from matplotlib.figure import Figure
from matplotlib.axes import Subplot
-import matplotlib.numerix as numpy
+import numpy
from wx import *
Modified: branches/transforms/examples/dynamic_image_wxagg.py
===================================================================
--- branches/transforms/examples/dynamic_image_wxagg.py 2007-09-10 17:40:47 UTC (rev 3823)
+++ branches/transforms/examples/dynamic_image_wxagg.py 2007-09-10 17:45:15 UTC (rev 3824)
@@ -12,26 +12,13 @@
import matplotlib
matplotlib.use('WXAgg')
-# jdh: you need to control Numeric vs numarray with numerix, otherwise
-# matplotlib may be using numeric under the hood and while you are
-# using numarray and this isn't efficient. Also, if you use
-# numerix=numarray, it is important to compile matplotlib for numarray
-# by setting NUMERIX = 'numarray' in setup.py before building
from matplotlib import rcParams
-##rcParams['numerix'] = 'numarray'
-
-
-# jdh: you can import cm directly, you don't need to go via
-# pylab
import matplotlib.cm as cm
from matplotlib.backends.backend_wxagg import Toolbar, FigureCanvasWxAgg
-# jdh: you don't need a figure manager in the GUI - this class was
-# designed for the pylab interface
-
from matplotlib.figure import Figure
-import matplotlib.numerix as numerix
+import numpy as npy
import wx
@@ -75,12 +62,12 @@
# jdh you can add a subplot directly from the fig rather than
# the fig manager
a = self.fig.add_subplot(111)
- self.x = numerix.arange(120.0)*2*numerix.pi/120.0
+ self.x = npy.arange(120.0)*2*npy.pi/120.0
self.x.resize((100,120))
- self.y = numerix.arange(100.0)*2*numerix.pi/100.0
+ self.y = npy.arange(100.0)*2*npy.pi/100.0
self.y.resize((120,100))
- self.y = numerix.transpose(self.y)
- z = numerix.sin(self.x) + numerix.cos(self.y)
+ self.y = npy.transpose(self.y)
+ z = npy.sin(self.x) + npy.cos(self.y)
self.im = a.imshow( z, cmap=cm.jet)#, interpolation='nearest')
def GetToolBar(self):
@@ -89,9 +76,9 @@
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.x += npy.pi/15
+ self.y += npy.pi/20
+ z = npy.sin(self.x) + npy.cos(self.y)
self.im.set_array(z)
self.canvas.draw()
#self.canvas.gui_repaint() # jdh wxagg_draw calls this already
Modified: branches/transforms/examples/dynamic_image_wxagg2.py
===================================================================
--- branches/transforms/examples/dynamic_image_wxagg2.py 2007-09-10 17:40:47 UTC (rev 3823)
+++ branches/transforms/examples/dynamic_image_wxagg2.py 2007-09-10 17:45:15 UTC (rev 3824)
@@ -12,24 +12,14 @@
import matplotlib
matplotlib.use('WXAgg')
-# jdh: you need to control Numeric vs numarray with numerix, otherwise
-# matplotlib may be using numeric under the hood and while you are
-# using numarray and this isn't efficient. Also, if you use
-# numerix=numarray, it is important to compile matplotlib for numarray
-# by setting NUMERIX = 'numarray' in setup.py before building
from matplotlib import rcParams
import numpy as npy
-# jdh: you can import cm directly, you don't need to go via
-# pylab
import matplotlib.cm as cm
from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg
from matplotlib.backends.backend_wx import NavigationToolbar2Wx
-# jdh: you don't need a figure manager in the GUI - this class was
-# designed for the pylab interface
-
from matplotlib.figure import Figure
from wx import *
Modified: branches/transforms/examples/embedding_in_gtk.py
===================================================================
--- branches/transforms/examples/embedding_in_gtk.py 2007-09-10 17:40:47 UTC (rev 3823)
+++ branches/transforms/examples/embedding_in_gtk.py 2007-09-10 17:45:15 UTC (rev 3824)
@@ -8,7 +8,7 @@
from matplotlib.axes import Subplot
from matplotlib.figure import Figure
-from matplotlib.numerix import arange, sin, pi
+from numpy import arange, sin, pi
# uncomment to select /GTK/GTKAgg/GTKCairo
from matplotlib.backends.backend_gtk import FigureCanvasGTK as FigureCanvas
Modified: branches/transforms/examples/embedding_in_gtk2.py
===================================================================
--- branches/transforms/examples/embedding_in_gtk2.py 2007-09-10 17:40:47 UTC (rev 3823)
+++ branches/transforms/examples/embedding_in_gtk2.py 2007-09-10 17:45:15 UTC (rev 3824)
@@ -7,7 +7,7 @@
from matplotlib.axes import Subplot
from matplotlib.figure import Figure
-from matplotlib.numerix import arange, sin, pi
+from numpy import arange, sin, pi
# uncomment to select /GTK/GTKAgg/GTKCairo
from matplotlib.backends.backend_gtk import FigureCanvasGTK as FigureCanvas
Modified: branches/transforms/examples/embedding_in_gtk3.py
===================================================================
--- branches/transforms/examples/embedding_in_gtk3.py 2007-09-10 17:40:47 UTC (rev 3823)
+++ branches/transforms/examples/embedding_in_gtk3.py 2007-09-10 17:45:15 UTC (rev 3824)
@@ -7,7 +7,7 @@
from matplotlib.axes import Subplot
from matplotlib.figure import Figure
-from matplotlib.numerix import arange, sin, pi
+from numpy import arange, sin, pi
# uncomment to select /GTK/GTKAgg/GTKCairo
#from matplotlib.backends.backend_gtk import FigureCanvasGTK as FigureCanvas
Modified: branches/transforms/examples/embedding_in_qt.py
===================================================================
--- branches/transforms/examples/embedding_in_qt.py 2007-09-10 17:40:47 UTC (rev 3823)
+++ branches/transforms/examples/embedding_in_qt.py 2007-09-10 17:45:15 UTC (rev 3824)
@@ -11,7 +11,7 @@
import sys, os, random
from qt import *
-from matplotlib.numerix import arange, sin, pi
+from numpy import arange, sin, pi
from matplotlib.backends.backend_qtagg import FigureCanvasQTAgg as FigureCanvas
from matplotlib.figure import Figure
Modified: branches/transforms/examples/embedding_in_qt4.py
===================================================================
--- branches/transforms/examples/embedding_in_qt4.py 2007-09-10 17:40:47 UTC (rev 3823)
+++ branches/transforms/examples/embedding_in_qt4.py 2007-09-10 17:45:15 UTC (rev 3824)
@@ -12,7 +12,7 @@
import sys, os, random
from PyQt4 import QtGui, QtCore
-from matplotlib.numerix import arange, sin, pi
+from numpy import arange, sin, pi
from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas
from matplotlib.figure import Figure
Modified: branches/transforms/examples/embedding_in_tk.py
===================================================================
--- branches/transforms/examples/embedding_in_tk.py 2007-09-10 17:40:47 UTC (rev 3823)
+++ branches/transforms/examples/embedding_in_tk.py 2007-09-10 17:45:15 UTC (rev 3824)
@@ -2,7 +2,7 @@
import matplotlib
matplotlib.use('TkAgg')
-from matplotlib.numerix import arange, sin, pi
+from numpy import arange, sin, pi
from matplotlib.axes import Subplot
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2TkAgg
from matplotlib.figure import Figure
Modified: branches/transforms/examples/embedding_in_tk2.py
===================================================================
--- branches/transforms/examples/embedding_in_tk2.py 2007-09-10 17:40:47 UTC (rev 3823)
+++ branches/transforms/examples/embedding_in_tk2.py 2007-09-10 17:45:15 UTC (rev 3824)
@@ -2,7 +2,7 @@
import matplotlib
matplotlib.use('TkAgg')
-from matplotlib.numerix import arange, sin, pi
+from numpy import arange, sin, pi
from matplotlib.axes import Subplot
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2TkAgg
from matplotlib.figure import Figure
Modified: branches/transforms/examples/embedding_in_wx.py
===================================================================
--- branches/transforms/examples/embedding_in_wx.py 2007-09-10 17:40:47 UTC (rev 3823)
+++ branches/transforms/examples/embedding_in_wx.py 2007-09-10 17:45:15 UTC (rev 3824)
@@ -44,7 +44,7 @@
from matplotlib.figure import Figure
from matplotlib.axes import Subplot
-import matplotlib.numerix as numpy
+import numpy
from wx import *
Modified: branches/transforms/examples/embedding_in_wx2.py
===================================================================
--- branches/transforms/examples/embedding_in_wx2.py 2007-09-10 17:40:47 UTC (rev 3823)
+++ branches/transforms/examples/embedding_in_wx2.py 2007-09-10 17:45:15 UTC (rev 3824)
@@ -4,7 +4,7 @@
toolbar - comment out the setA_toolbar line for no toolbar
"""
-from matplotlib.numerix import arange, sin, pi
+from numpy import arange, sin, pi
import matplotlib
Modified: branches/transforms/examples/embedding_in_wx3.py
===================================================================
--- branches/transforms/examples/embedding_in_wx3.py 2007-09-10 17:40:47 UTC (rev 3823)
+++ branches/transforms/examples/embedding_in_wx3.py 2007-09-10 17:45:15 UTC (rev 3824)
@@ -25,8 +25,6 @@
from matplotlib.backends.backend_wxagg import Toolbar, FigureCanvasWxAgg
from matplotlib.figure import Figure
import numpy as npy
-import matplotlib.numerix.mlab as mlab
-from matplotlib.mlab import meshgrid
from wx import *
from wx.xrc import *
@@ -61,11 +59,11 @@
x = npy.arange(120.0)*2*npy.pi/60.0
y = npy.arange(100.0)*2*npy.pi/50.0
- self.x, self.y = meshgrid(x, y)
+ self.x, self.y = npy.meshgrid(x, y)
z = npy.sin(self.x) + npy.cos(self.y)
self.im = a.imshow( z, cmap=cm.jet)#, interpolation='nearest')
- zmax = mlab.max(mlab.max(z))-ERR_TOL
+ zmax = npy.amax(z) - ERR_TOL
ymax_i, xmax_i = npy.nonzero(z >= zmax)
if self.im.origin == 'upper':
ymax_i = z.shape[0]-ymax_i
@@ -84,7 +82,7 @@
z = npy.sin(self.x) + npy.cos(self.y)
self.im.set_array(z)
- zmax = mlab.max(mlab.max(z))-ERR_TOL
+ zmax = npy.amax(z) - ERR_TOL
ymax_i, xmax_i = npy.nonzero(z >= zmax)
if self.im.origin == 'upper':
ymax_i = z.shape[0]-ymax_i
Modified: branches/transforms/examples/embedding_in_wx4.py
===================================================================
--- branches/transforms/examples/embedding_in_wx4.py 2007-09-10 17:40:47 UTC (rev 3823)
+++ branches/transforms/examples/embedding_in_wx4.py 2007-09-10 17:45:15 UTC (rev 3824)
@@ -4,7 +4,7 @@
toolbar
"""
-from matplotlib.numerix import arange, sin, pi
+from numpy import arange, sin, pi
import matplotlib
@@ -19,7 +19,7 @@
from matplotlib.backends.backend_wx import _load_bitmap
from matplotlib.figure import Figure
-from matplotlib.numerix.mlab import rand
+from numpy.random import rand
from wx import *
Deleted: branches/transforms/examples/gdtest.py
===================================================================
--- branches/transforms/examples/gdtest.py 2007-09-10 17:40:47 UTC (rev 3823)
+++ branches/transforms/examples/gdtest.py 2007-09-10 17:45:15 UTC (rev 3824)
@@ -1,34 +0,0 @@
-#!/usr/bin/env python
-import matplotlib
-matplotlib.use('GD')
-from pylab import *
-
-def f(t):
- s1 = cos(2*pi*t)
- e1 = exp(-t)
- return multiply(s1,e1)
-
-t1 = arange(0.0, 5.0, .1)
-t2 = arange(0.0, 5.0, 0.02)
-t3 = arange(0.0, 2.0, 0.01)
-
-
-if 1:
- subplot(211)
- l = plot(t1, f(t1), 'k-^')
- setp(l, 'markerfacecolor', 'r')
- xlim(0,5)
- title('A tale of 2 subplots', fontsize=12)
- ylabel('Signal 1', fontsize=10)
-
- subplot(212)
- l = plot(t1, f(t1), 'k->')
- xlim(0,5)
- ylabel('Signal 2', fontsize=10)
- xlabel('time (s)', fontsize=10, fontname='Courier')
-
-ax = gca()
-
-
-#savefig('gdtest', dpi=150)
-show()
Modified: branches/transforms/examples/gtk_spreadsheet.py
===================================================================
--- branches/transforms/examples/gtk_spreadsheet.py 2007-09-10 17:40:47 UTC (rev 3823)
+++ branches/transforms/examples/gtk_spreadsheet.py 2007-09-10 17:45:15 UTC (rev 3824)
@@ -14,15 +14,13 @@
matplotlib.use('GTKAgg') # or 'GTK'
from matplotlib.backends.backend_gtk import FigureCanvasGTK as FigureCanvas
-#from matplotlib.numerix import rand
-from matplotlib.numerix.random_array import random
+from numpy.random import random
from matplotlib.figure import Figure
class DataManager(gtk.Window):
numRows, numCols = 20,10
- #data = rand(numRows, numCols)
data = random((numRows, numCols))
def __init__(self):
Modified: branches/transforms/examples/histogram_demo_canvasagg.py
===================================================================
--- branches/transforms/examples/histogram_demo_canvasagg.py 2007-09-10 17:40:47 UTC (rev 3823)
+++ branches/transforms/examples/histogram_demo_canvasagg.py 2007-09-10 17:45:15 UTC (rev 3824)
@@ -13,7 +13,8 @@
from matplotlib.figure import Figure
from matplotlib.axes import Subplot
from matplotlib.mlab import normpdf
-from matplotlib.numerix.mlab import randn
+from numpy.random import randn
+import numpy
fig = Figure(figsize=(5,4), dpi=100)
ax = fig.add_subplot(111)
@@ -42,14 +43,14 @@
s = canvas.tostring_rgb() # save this and convert to bitmap as needed
-# get the figure dimensions for creating bitmaps or numeric arrays,
+# get the figure dimensions for creating bitmaps or numpy arrays,
# etc.
l,b,w,h = fig.bbox.get_bounds()
w, h = int(w), int(h)
if 0:
- # convert to a Numeric array
- X = fromstring(s, UInt8)
+ # convert to a numpy array
+ X = numpy.fromstring(s, numpy.uint8)
X.shape = h, w, 3
if 0:
Deleted: branches/transforms/examples/image_demo_na.py
===================================================================
--- branches/transforms/examples/image_demo_na.py 2007-09-10 17:40:47 UTC (rev 3823)
+++ branches/transforms/examples/image_demo_na.py 2007-09-10 17:45:15 UTC (rev 3824)
@@ -1,40 +0,0 @@
-#!/usr/bin/env python
-from matplotlib import rcParams
-rcParams['numerix'] = 'numarray'
-
-from pylab import *
-
-
-def bivariate_normal(X, Y, sigmax=1.0, sigmay=1.0,
- mux=0.0, muy=0.0, sigmaxy=0.0):
- """
- Bivariate gaussan distribution for equal shape X, Y
-
- http://mathworld.wolfram.com/BivariateNormalDistribution.html
- """
- Xmu = X-mux
- Ymu = Y-muy
-
- rho = sigmaxy/(sigmax*sigmay)
- z = (1.0/sigmax**2)*Xmu**2 + (1.0/sigmay)*Ymu**2 - (2*rho/(sigmax*sigmay))*Xmu*Ymu
- return 1.0/(2*pi*sigmax*sigmay*(1-rho**2)) * exp( -1/(2*(1-rho**2))*z)
-
-
-delta = 0.025
-x = arange(-3.0, 3.0, delta)
-y = arange(-3.0, 3.0, delta)
-X,Y = meshgrid(x, y)
-Z1 = bivariate_normal(X, Y, 1.0, 1.0, 0.0, 0.0)
-Z2 = bivariate_normal(X, Y, 1.5, 0.5, 1, 1)
-
-# difference of Gaussians
-im = imshow(Z2-Z1)
-
-# set the interpolation method: 'nearest', 'bilinear', 'bicubic' and much more
-im.set_interpolation('bilinear')
-
-
-axis('off')
-#savefig('test')
-show()
-
Modified: branches/transforms/examples/image_masked.py
===================================================================
--- branches/transforms/examples/image_masked.py 2007-09-10 17:40:47 UTC (rev 3823)
+++ branches/transforms/examples/image_masked.py 2007-09-10 17:45:15 UTC (rev 3824)
@@ -4,7 +4,7 @@
'''
from pylab import *
-import matplotlib.numerix.ma as ma
+import matplotlib.numerix.npyma as ma
import matplotlib.colors as colors
delta = 0.025
Modified: branches/transforms/examples/mathtext_wx.py
===================================================================
--- branches/transforms/examples/mathtext_wx.py 2007-09-10 17:40:47 UTC (rev 3823)
+++ branches/transforms/examples/mathtext_wx.py 2007-09-10 17:45:15 UTC (rev 3824)
@@ -5,7 +5,7 @@
import matplotlib
matplotlib.use("WxAgg")
-from matplotlib.numerix import arange, sin, pi, cos, log
+from numpy import arange, sin, pi, cos, log
from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FigureCanvas
from matplotlib.backends.backend_wx import NavigationToolbar2Wx
from matplotlib.figure import Figure
@@ -42,14 +42,14 @@
self.figure = Figure()
self.axes = self.figure.add_subplot(111)
self.change_plot(0)
-
+
self.canvas = FigureCanvas(self, -1, self.figure)
self.sizer = wx.BoxSizer(wx.VERTICAL)
self.add_buttonbar()
self.sizer.Add(self.canvas, 1, wx.LEFT | wx.TOP | wx.GROW)
self.add_toolbar() # comment this out for no toolbar
-
+
menuBar = wx.MenuBar()
# File Menu
@@ -104,21 +104,21 @@
def OnChangePlot(self, event):
self.change_plot(event.GetId() - 1000)
-
+
def change_plot(self, plot_number):
t = arange(1.0,3.0,0.01)
s = functions[plot_number][1](t)
self.axes.clear()
self.axes.plot(t, s)
self.Refresh()
-
+
class MyApp(wx.App):
def OnInit(self):
frame = CanvasFrame(None, "wxPython mathtext demo app")
self.SetTopWindow(frame)
frame.Show(True)
return True
-
+
app = MyApp()
app.MainLoop()
Modified: branches/transforms/examples/mpl_with_glade.py
===================================================================
--- branches/transforms/examples/mpl_with_glade.py 2007-09-10 17:40:47 UTC (rev 3823)
+++ branches/transforms/examples/mpl_with_glade.py 2007-09-10 17:45:15 UTC (rev 3824)
@@ -8,7 +8,7 @@
from matplotlib.backends.backend_gtkagg import NavigationToolbar2GTKAgg as NavigationToolbar
from matplotlib.widgets import SpanSelector
-from matplotlib.numerix import arange, sin, pi
+from numpy import arange, sin, pi
import gtk
import gtk.glade
Modified: branches/transforms/examples/multi_image.py
===================================================================
--- branches/transforms/examples/multi_image.py 2007-09-10 17:40:47 UTC (rev 3823)
+++ branches/transforms/examples/multi_image.py 2007-09-10 17:45:15 UTC (rev 3824)
@@ -5,19 +5,20 @@
It also illustrates colorbar tick labelling with a multiplier.
'''
-import pylab
+from matplotlib.pyplot import figure, show, sci
from matplotlib import cm, colors
from matplotlib.font_manager import FontProperties
-from matplotlib.numerix.mlab import amin, amax
+from numpy import amin, amax, ravel
+from numpy.random import rand
Nr = 3
Nc = 2
-fig = pylab.gcf()
+fig = figure()
cmap = cm.cool
figtitle = 'Multiple images'
-t = pylab.gcf().text(0.5, 0.95, figtitle,
+t = fig.text(0.5, 0.95, figtitle,
horizontalalignment='center',
fontproperties=FontProperties(size=16))
@@ -37,8 +38,8 @@
a.set_xticklabels([])
# Make some fake data with a range that varies
# somewhat from one plot to the next.
- data =((1+i+j)/10.0)*pylab.rand(10,20)*1e-6
- dd = pylab.ravel(data)
+ data =((1+i+j)/10.0)*rand(10,20)*1e-6
+ dd = ravel(data)
# Manually find the min and max of all colors for
# use in setting the color scale.
vmin = min(vmin, amin(dd))
@@ -60,12 +61,13 @@
# We need the following only if we want to run this
# script interactively and be able to change the colormap.
-pylab.sci(images[0])
-pylab.show()
+sci(images[0])
+show()
+
Modified: branches/transforms/examples/pcolor_nonuniform.py
===================================================================
--- branches/transforms/examples/pcolor_nonuniform.py 2007-09-10 17:40:47 UTC (rev 3823)
+++ branches/transforms/examples/pcolor_nonuniform.py 2007-09-10 17:45:15 UTC (rev 3824)
@@ -1,11 +1,11 @@
-from pylab import figure, show
-import matplotlib.numerix as nx
+from matplotlib.pyplot import figure, show
+import numpy as npy
from matplotlib.image import NonUniformImage
-x = nx.arange(-4, 4, 0.005)
-y = nx.arange(-4, 4, 0.005)
+x = npy.arange(-4, 4, 0.005)
+y = npy.arange(-4, 4, 0.005)
print 'Size %d points' % (len(x) * len(y))
-z = nx.sqrt(x[nx.NewAxis,:]**2 + y[:,nx.NewAxis]**2)
+z = npy.sqrt(x[npy.newaxis,:]**2 + y[:,npy.newaxis]**2)
fig = figure()
ax = fig.add_subplot(111)
Modified: branches/transforms/examples/polar_bar.py
===================================================================
--- branches/transforms/examples/polar_bar.py 2007-09-10 17:40:47 UTC (rev 3823)
+++ branches/transforms/examples/polar_bar.py 2007-09-10 17:45:15 UTC (rev 3824)
@@ -1,9 +1,8 @@
#!/usr/bin/env python
-import matplotlib.numerix as nx
-from matplotlib.mlab import linspace
+import numpy as npy
import matplotlib.cm as cm
-from pylab import figure, show, rc
+from matplotlib.pyplot import figure, show, rc
# force square figure and square axes looks better for polar, IMO
@@ -11,9 +10,9 @@
ax = fig.add_axes([0.1, 0.1, 0.8, 0.8], polar=True)
N = 20
-theta = nx.arange(0.0, 2*nx.pi, 2*nx.pi/N)
-radii = 10*nx.mlab.rand(N)
-width = nx.pi/4*nx.mlab.rand(N)
+theta = npy.arange(0.0, 2*npy.pi, 2*npy.pi/N)
+radii = 10*npy.random.rand(N)
+width = npy.pi/4*npy.random.rand(N)
bars = ax.bar(theta, radii, width=width, bottom=0.1)
for r,bar in zip(radii, bars):
bar.set_facecolor( cm.jet(r/10.))
Modified: branches/transforms/examples/polar_demo.py
===================================================================
--- branches/transforms/examples/polar_demo.py 2007-09-10 17:40:47 UTC (rev 3823)
+++ branches/transforms/examples/polar_demo.py 2007-09-10 17:45:15 UTC (rev 3824)
@@ -39,8 +39,8 @@
# See the pylab rgrids and thetagrids functions for
# information on how to customize the grid locations and labels
-import matplotlib.numerix as nx
-from pylab import figure, show, rc
+import numpy as npy
+from matplotlib.pyplot import figure, show, rc
# radar green, solid grid lines
rc('grid', color='#316931', linewidth=1, linestyle='-')
@@ -51,8 +51,8 @@
fig = figure(figsize=(8,8))
ax = fig.add_axes([0.1, 0.1, 0.8, 0.8], polar=True, axisbg='#d5de9c')
-r = nx.arange(0, 3.0, 0.01)
-theta = 2*nx.pi*r
+r = npy.arange(0, 3.0, 0.01)
+theta = 2*npy.pi*r
ax.plot(theta, r, color='#ee8d18', lw=3)
ax.set_rmax(2.0)
Modified: branches/transforms/examples/polar_legend.py
===================================================================
--- branches/transforms/examples/polar_legend.py 2007-09-10 17:40:47 UTC (rev 3823)
+++ branches/transforms/examples/polar_legend.py 2007-09-10 17:45:15 UTC (rev 3824)
@@ -1,7 +1,7 @@
#!/usr/bin/env python
-import matplotlib.numerix as nx
-from pylab import figure, show, rc
+import numpy as npy
+from matplotlib.pyplot import figure, show, rc
# radar green, solid grid lines
rc('grid', color='#316931', linewidth=1, linestyle='-')
@@ -12,8 +12,8 @@
fig = figure(figsize=(8,8))
ax = fig.add_axes([0.1, 0.1, 0.8, 0.8], polar=True, axisbg='#d5de9c')
-r = nx.arange(0, 3.0, 0.01)
-theta = 2*nx.pi*r
+r = npy.arange(0, 3.0, 0.01)
+theta = 2*npy.pi*r
ax.plot(theta, r, color='#ee8d18', lw=3, label='a line')
ax.plot(0.5*theta, r, color='blue', ls='--', lw=3, label='another line')
ax.legend()
Modified: branches/transforms/examples/poly_editor.py
===================================================================
--- branches/transforms/examples/poly_editor.py 2007-09-10 17:40:47 UTC (rev 3823)
+++ branches/transforms/examples/poly_editor.py 2007-09-10 17:45:15 UTC (rev 3824)
@@ -5,8 +5,7 @@
"""
from matplotlib.artist import Artist
from matplotlib.patches import Polygon, CirclePolygon
-from matplotlib.numerix import sqrt, nonzero, equal, asarray, dot, Float
-from matplotlib.numerix.mlab import amin
+from numpy import sqrt, nonzero, equal, asarray, dot, amin
from matplotlib.mlab import dist_point_to_segment
Modified: branches/transforms/examples/printing_in_wx.py
===================================================================
--- branches/transforms/examples/printing_in_wx.py 2007-09-10 17:40:47 UTC (rev 3823)
+++ branches/transforms/examples/printing_in_wx.py 2007-09-10 17:45:15 UTC (rev 3824)
@@ -39,7 +39,7 @@
from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FigCanvas
from matplotlib.figure import Figure
-import matplotlib.numerix as numpy
+import numpy
class PlotFrame(wx.Frame):
help_msg=""" Menus for
Modified: branches/transforms/examples/pythonic_matplotlib.py
===================================================================
--- branches/transforms/examples/pythonic_matplotlib.py 2007-09-10 17:40:47 UTC (rev 3823)
+++ branches/transforms/examples/pythonic_matplotlib.py 2007-09-10 17:45:15 UTC (rev 3824)
@@ -54,7 +54,7 @@
from pylab import figure, close, axes, subplot, show
-from matplotlib.numerix import arange, sin, pi
+from numpy import arange, sin, pi
t = arange(0.0, 1.0, 0.01)
Modified: branches/transforms/examples/rc_traits.py
===================================================================
--- branches/transforms/examples/rc_traits.py 2007-09-10 17:40:47 UTC (rev 3823)
+++ branches/transforms/examples/rc_traits.py 2007-09-10 17:45:15 UTC (rev 3824)
@@ -128,8 +128,8 @@
antialiased = flexible_true_trait
timezones = 'UTC', 'US/Central', 'ES/Eastern' # fixme: and many more
-backends = ('GTKAgg', 'Cairo', 'FltkAgg', 'GD', 'GDK', 'GTK', 'Agg',
- 'GTKCairo', 'Paint', 'PS', 'SVG', 'Template', 'TkAgg',
+backends = ('GTKAgg', 'Cairo', 'FltkAgg', 'GDK', 'GTK', 'Agg',
+ 'GTKCairo', 'PS', 'SVG', 'Template', 'TkAgg',
'WX')
class RC(traits.HasTraits):
Modified: branches/transforms/examples/scatter_masked.py
===================================================================
--- branches/transforms/examples/scatter_masked.py 2007-09-10 17:40:47 UTC (rev 3823)
+++ branches/transforms/examples/scatter_masked.py 2007-09-10 17:45:15 UTC (rev 3824)
@@ -1,6 +1,6 @@
#!/usr/bin/env python
from pylab import *
-import matplotlib.numerix.ma as ma
+import matplotlib.numerix.npyma as ma
N = 100
r0 = 0.6
Modified: branches/transforms/examples/strip_chart_demo.py
===================================================================
--- branches/transforms/examples/strip_chart_demo.py 2007-09-10 17:40:47 UTC (rev 3823)
+++ branches/transforms/examples/strip_chart_demo.py 2007-09-10 17:45:15 UTC (rev 3824)
@@ -12,7 +12,7 @@
import gobject, gtk
import matplotlib
matplotlib.use('GTKAgg')
-import matplotlib.numerix as nx
+import numpy as npy
from matplotlib.lines import Line2D
@@ -36,9 +36,9 @@
def emitter(self, p=0.01):
'return a random value with probability p, else 0'
- v = nx.mlab.rand(1)
+ v = npy.random.rand(1)
if v>p: return 0.
- else: return nx.mlab.rand(1)
+ else: return npy.random.rand(1)
def update(self, *args):
if self.background is None: return True
Modified: branches/transforms/examples/tex_demo.py
===================================================================
--- branches/transforms/examples/tex_demo.py 2007-09-10 17:40:47 UTC (rev 3823)
+++ branches/transforms/examples/tex_demo.py 2007-09-10 17:45:15 UTC (rev 3824)
@@ -11,8 +11,8 @@
"""
from matplotlib import rc
-from matplotlib.numerix import arange, cos, pi
-from pylab import figure, axes, plot, xlabel, ylabel, title, \
+from numpy import arange, cos, pi
+from matplotlib.pyplot import figure, axes, plot, xlabel, ylabel, title, \
grid, savefig, show
Modified: branches/transforms/examples/tex_unicode_demo.py
===================================================================
--- branches/transforms/examples/tex_unicode_demo.py 2007-09-10 17:40:47 UTC (rev 3823)
+++ branches/transforms/examples/tex_unicode_demo.py 2007-09-10 17:45:15 UTC (rev 3824)
@@ -7,8 +7,8 @@
from matplotlib import rcParams
rcParams['text.usetex']=True
rcParams['text.latex.unicode']=True
-from matplotlib.numerix import arange, cos, pi
-from pylab import figure, axes, plot, xlabel, ylabel, title, \
+from numpy import arange, cos, pi
+from matplotlib.pyplot import figure, axes, plot, xlabel, ylabel, title, \
grid, savefig, show
figure(1)
Modified: branches/transforms/examples/vline_demo.py
===================================================================
--- branches/transforms/examples/vline_demo.py 2007-09-10 17:40:47 UTC (rev 3823)
+++ branches/transforms/examples/vline_demo.py 2007-09-10 17:45:15 UTC (rev 3824)
@@ -1,17 +1,17 @@
#!/usr/bin/env python
-from pylab import *
-from matplotlib.numerix import sin, exp, multiply, absolute, pi
-from matplotlib.numerix.random_array import normal
+from matplotlib.pyplot import *
+from numpy import sin, exp, absolute, pi, arange
+from numpy.random import normal
def f(t):
s1 = sin(2*pi*t)
e1 = exp(-t)
- return absolute(multiply(s1,e1))+.05
+ return absolute((s1*e1))+.05
t = arange(0.0, 5.0, 0.1)
s = f(t)
-nse = multiply(normal(0.0, 0.3, t.shape), s)
+nse = normal(0.0, 0.3, t.shape) * s
plot(t, s+nse, 'b^')
vlines(t, [0], s)
Modified: branches/transforms/examples/webapp_demo.py
===================================================================
--- branches/transforms/examples/webapp_demo.py 2007-09-10 17:40:47 UTC (rev 3823)
+++ branches/transforms/examples/webapp_demo.py 2007-09-10 17:45:15 UTC (rev 3824)
@@ -21,7 +21,7 @@
from matplotlib.backends.backend_agg import FigureCanvasAgg
from matplotlib.figure import Figure
from matplotlib.cbook import iterable
-import matplotlib.numerix as nx
+import numpy as npy
def make_fig():
"""
@@ -40,9 +40,9 @@
line, = ax.plot([1,2,3], 'ro--', markersize=12, markerfacecolor='g')
# make a translucent scatter collection
- x = nx.mlab.rand(100)
- y = nx.mlab.rand(100)
- area = nx.pi*(10 * nx.mlab.rand(100))**2 # 0 to 10 point radiuses
+ x = npy.random.rand(100)
+ y = npy.random.rand(100)
+ area = npy.pi*(10 * npy.random.rand(100))**2 # 0 to 10 point radiuses
c = ax.scatter(x,y,area)
c.set_alpha(0.5)
Modified: branches/transforms/examples/wxcursor_demo.py
===================================================================
--- branches/transforms/examples/wxcursor_demo.py 2007-09-10 17:40:47 UTC (rev 3823)
+++ branches/transforms/examples/wxcursor_demo.py 2007-09-10 17:45:15 UTC (rev 3824)
@@ -6,7 +6,7 @@
from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FigureCanvas
from matplotlib.backends.backend_wx import NavigationToolbar2Wx
from matplotlib.figure import Figure
-from matplotlib.numerix import arange, sin, pi
+from numpy import arange, sin, pi
import wx
Modified: branches/transforms/lib/matplotlib/__init__.py
===================================================================
--- branches/transforms/lib/matplotlib/__init__.py 2007-09-10 17:40:47 UTC (rev 3823)
+++ branches/transforms/lib/matplotlib/__init__.py 2007-09-10 17:45:15 UTC (rev 3824)
@@ -530,16 +530,16 @@
class RcParams(dict):
-
+
"""A dictionary object including validation
-
+
validating functions are defined and associated with rc parameters in
rcsetup.py
"""
-
+
validate = dict([ (key, converter) for key, (default, converter) in \
defaultParams.iteritems() ])
-
+
def __setitem__(self, key, val):
try:
if key in _deprecated_map.keys():
@@ -620,7 +620,7 @@
ret['datapath'] = get_data_path()
verbose.report('loaded rc file %s'%fname)
-
+
return ret
Modified: branches/transforms/lib/matplotlib/axes.py
===================================================================
--- branches/transforms/lib/matplotlib/axes.py 2007-09-10 17:40:47 UTC (rev 3823)
+++ branches/transforms/lib/matplotlib/axes.py 2007-09-10 17:45:15 UTC (rev 3824)
@@ -1867,31 +1867,6 @@
c =mcolors.colorConverter.to_rgba(c)
self._cursorProps = lw, c
-
- def panx(self, numsteps):
- 'Pan the x axis numsteps (plus pan right, minus pan left)'
- self.xaxis.pan(numsteps)
- xmin, xmax = self.viewLim.intervalx().get_bounds()
- self._send_xlim_event()
-
- def pany(self, numsteps):
- 'Pan the x axis numsteps (plus pan up, minus pan down)'
- self.yaxis.pan(numsteps)
- self._send_ylim_event()
-
- def zoomx(self, numsteps):
- 'Zoom in on the x xaxis numsteps (plus for zoom in, minus for zoom out)'
- self.xaxis.zoom(numsteps)
- xmin, xmax = self.viewLim.intervalx().get_bounds()
- self._send_xlim_event()
-
- def zoomy(self, numsteps):
- 'Zoom in on the x xaxis numsteps (plus for zoom in, minus for zoom out)'
- self.yaxis.zoom(numsteps)
- self._send_ylim_event()
-
-
-
def connect(self, s, func):
"""
Register observers to be notified when certain events occur. Register
@@ -1913,6 +1888,7 @@
def disconnect(self, cid):
'disconnect from the Axes event.'
raise DeprecationWarning('use the callbacks CallbackRegistry instance instead')
+
def get_children(self):
'return a list of child artists'
children = []
@@ -5683,38 +5659,14 @@
'ylabel not implemented'
raise NotImplementedError('ylabel not defined for polar axes (yet)')
+ def set_xlim(self, xmin=None, xmax=None, emit=True, **kwargs):
+ 'xlim not implemented'
+ raise NotImplementedError('xlim not meaningful for polar axes')
- def set_xlim(self, xmin=None, xmax=None, emit=True):
- """
- set the xlimits
- ACCEPTS: len(2) sequence of floats
- """
- if xmax is None and iterable(xmin):
- xmin,xmax = xmin
+ def set_ylim(self, ymin=None, ymax=None, emit=True, **kwargs):
+ 'ylim not implemented'
+ raise NotImplementedError('ylim not meaningful for polar axes')
- old_xmin,old_xmax = self.get_xlim()
- if xmin is None: xmin = old_xmin
- if xmax is None: xmax = old_xmax
-
- self.viewLim.intervalx().set_bounds(xmin, xmax)
- if emit: self._send_xlim_event()
-
-
- def set_ylim(self, ymin=None, ymax=None, emit=True):
- """
- set the ylimits
- ACCEPTS: len(2) sequence of floats
- """
- if ymax is None and iterable(ymin):
- ymin,ymax = ymin
-
- old_ymin,old_ymax = self.get_ylim()
- if ymin is None: ymin = old_ymin
- if ymax is None: ymax = old_ymax
-
- self.viewLim.intervaly().set_bounds(ymin, ymax)
- if emit: self._send_ylim_event()
-
def get_xscale(self):
'return the xaxis scale string'
return 'polar'
@@ -5765,10 +5717,9 @@
"""
# this is some discarded code I was using to find the minimum positive
# data point for some log scaling fixes. I realized there was a
-# cleaner way to do it, but am ke
-eping this around as an example for
+# cleaner way to do it, but am keeping this around as an example for
# how to get the data out of the axes. Might want to make something
-# like this a method one day, or better yet make get_verts and Artist
+# like this a method one day, or better yet make get_verts an Artist
# method
minx, maxx = self.get_xlim()
Modified: branches/transforms/lib/matplotlib/backends/__init__.py
===================================================================
--- branches/transforms/lib/matplotlib/backends/__init__.py 2007-09-10 17:40:47 UTC (rev 3823)
+++ branches/transforms/lib/matplotlib/backends/__init__.py 2007-09-10 17:45:15 UTC (rev 3824)
@@ -7,7 +7,7 @@
interactive_bk = ['GTK', 'GTKAgg', 'GTKCairo', 'FltkAgg', 'QtAgg', 'Qt4Agg',
'TkAgg', 'WX', 'WXAgg', 'CocoaAgg', 'Aqt']
-non_interactive_bk = ['Agg2', 'Agg', 'Cairo', 'EMF', 'GD', 'GDK', 'Paint',
+non_interactive_bk = ['Agg2', 'Agg', 'Cairo', 'EMF', 'GDK',
'Pdf', 'PS', 'SVG', 'Template']
all_backends = interactive_bk + non_interactive_bk
Deleted: branches/transforms/lib/matplotlib/backends/backend_gd.py
===================================================================
--- branches/transforms/lib/matplotlib/backends/backend_gd.py 2007-09-10 17:40:47 UTC (rev 3823)
+++ branches/transforms/lib/matplotlib/backends/backend_gd.py 2007-09-10 17:45:15 UTC (rev 3824)
@@ -1,374 +0,0 @@
-"""
-A gd backend http://newcenturycomputers.net/projects/gdmodule.html
-"""
-
-
-from __future__ import division
-import sys, os, math, warnings
-
-import numpy as npy
-
-try:
- import gd
-except ImportError:
- print >>sys.stderr, 'You must first install the gd module http://newcenturycomputers.net/projects/gdmodule.html'
- sys.exit()
-
-from matplotlib.backend_bases import RendererBase, \
- GraphicsContextBase, FigureManagerBase, FigureCanvasBase
-from matplotlib import verbose
-from matplotlib._pylab_helpers import Gcf
-from matplotlib.cbook import enumerate, pieces, is_string_like
-from matplotlib.colors import colorConverter
-from matplotlib.figure import Figure
-from matplotlib.transforms import Bbox
-from matplotlib.font_manager import findfont
-# support old font names
-if (os.environ.has_key('GDFONTPATH') and not
- os.environ.has_key('TTFPATH')):
- os.environ['TTFPATH'] = os.environ['GDFONTPATH']
-
-
-
-
-PIXELS_PER_INCH = 96 # constant GD uses for screen DPI
-
-
-def round(x):
- return int(math.floor(x+0.5))
-
-
-class RendererGD(RendererBase):
- """
- The renderer handles all the drawing primitives using a graphics
- context instance that controls the colors/styles
- """
-
-
- # todo: can gd support cap and join styles?
- def __init__(self, im, dpi):
- "Initialize the renderer with a gd image instance"
- self.im = im
- self._cached = {} # a map from get_color args to colors
-
- self.width, self.height = im.size()
- self.dpi = dpi
-
-
- def get_canvas_width_height(...
[truncated message content] |