SourceForge logo
SourceForge logo
Menu

matplotlib-checkins — Commit notification. DO NOT POST to this list, just subscribe to it.

You can subscribe to this list here.

2007 Jan
Feb
Mar
Apr
May
Jun
Jul
(115)
Aug
(120)
Sep
(137)
Oct
(170)
Nov
(461)
Dec
(263)
2008 Jan
(120)
Feb
(74)
Mar
(35)
Apr
(74)
May
(245)
Jun
(356)
Jul
(240)
Aug
(115)
Sep
(78)
Oct
(225)
Nov
(98)
Dec
(271)
2009 Jan
(132)
Feb
(84)
Mar
(74)
Apr
(56)
May
(90)
Jun
(79)
Jul
(83)
Aug
(296)
Sep
(214)
Oct
(76)
Nov
(82)
Dec
(66)
2010 Jan
(46)
Feb
(58)
Mar
(51)
Apr
(77)
May
(58)
Jun
(126)
Jul
(128)
Aug
(64)
Sep
(50)
Oct
(44)
Nov
(48)
Dec
(54)
2011 Jan
(68)
Feb
(52)
Mar
Apr
May
Jun
Jul
Aug
Sep
Oct
Nov
Dec
(1)
2018 Jan
Feb
Mar
Apr
May
(1)
Jun
Jul
Aug
Sep
Oct
Nov
Dec

Showing results of 5455

<< < 1 .. 217 218 219 (Page 219 of 219)
Revision: 3536
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3536&view=rev
Author: edin1
Date: 2007年07月16日 01:01:21 -0700 (2007年7月16日)
Log Message:
-----------
Cleaned up setup.py. Removed references to Python 2.2, distutils.
Modified Paths:
--------------
 trunk/matplotlib/setup.py
Modified: trunk/matplotlib/setup.py
===================================================================
--- trunk/matplotlib/setup.py	2007年07月16日 07:47:32 UTC (rev 3535)
+++ trunk/matplotlib/setup.py	2007年07月16日 08:01:21 UTC (rev 3536)
@@ -1,8 +1,4 @@
 """
-Note! If you are building for python2.2, you must comment out the
-py_modules line below and manually copy lib/pylab.py to
-site-packages/pylab.py
-
 You will need to have freetype, libpng and zlib installed to compile
 matplotlib, inlcuding the *-devel versions of these libraries if you
 are using a package manager like RPM or debian.
@@ -62,8 +58,6 @@
 import sys
 major, minor1, minor2, s, tmp = sys.version_info
 
-if major==2 and minor1==2:
- print >> sys.stderr, "***\n\nWARNING, see build info for python2.2 in the header of setup.py\n\n***"
 if major==2 and minor1<=3:
 # setuptools monkeypatches distutils.core.Distribution to support
 # package_data
@@ -78,12 +72,13 @@
 directory.""")
 
 import glob
-from distutils.core import Extension, setup
+#from distutils.core import Extension, setup
+from setuptools import setup
 from setupext import build_agg, build_gtkagg, build_tkagg, build_wxagg,\
 build_ft2font, build_image, build_windowing, build_transforms, \
 build_contour, build_nxutils, build_enthought, build_swigagg, build_gdk, \
 build_subprocess, build_ttconv
-import distutils.sysconfig
+#import distutils.sysconfig
 
 for line in file('lib/matplotlib/__init__.py').readlines():
 if line[:11] == '__version__':
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 3535
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3535&view=rev
Author: efiring
Date: 2007年07月16日 00:47:32 -0700 (2007年7月16日)
Log Message:
-----------
Improved docstring for matplotlib package
Modified Paths:
--------------
 trunk/matplotlib/lib/matplotlib/__init__.py
Modified: trunk/matplotlib/lib/matplotlib/__init__.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/__init__.py	2007年07月16日 02:16:22 UTC (rev 3534)
+++ trunk/matplotlib/lib/matplotlib/__init__.py	2007年07月16日 07:47:32 UTC (rev 3535)
@@ -1,144 +1,57 @@
 """
 This is an object-orient plotting library.
 
-The following matlab(TM) compatible commands are provided by
+A procedural interface is provided by the companion pylab
+module, which may be imported directly, e.g.
 
- >>> from pylab import *
+ from pylab import *
 
-Plotting commands
+or using ipython:
 
- axes - Create a new axes
- axhline - draw a horizontal line across axes
- axvline - draw a vertical line across axes
- axhspan - draw a horizontal bar across axes
- axvspan - draw a vertical bar across axes
- axis - Set or return the current axis limits
- bar - make a bar chart
- barh - a horizontal bar chart
- boxplot - make a box and whisker plot
- cla - clear current axes
- clf - clear a figure window
- close - close a figure window
- colorbar - add a colorbar to the current figure
- cohere - make a plot of coherence
- contour - make a contour plot
- csd - make a plot of cross spectral density
- draw - Force a redraw of the current figure
- errorbar - make an errorbar graph
- figlegend - make legend on the figure rather than the axes
- figimage - make a figure image
- figtext - add text in figure coords
- figure - create or change active figure
- fill - make filled polygons
- gca - return the current axes
- gcf - return the current figure
- gci - get the current image, or None
- get - get a handle graphics property
- gray - set the current colormap to gray
- jet - set the current colormap to jet
- hist - make a histogram
- hold - set the axes hold state
- legend - make an axes legend
- loglog - a log log plot
- imread - load image file into array
- imshow - plot image data
- pcolor - make a pseudocolor plot
- plot - make a line plot
- psd - make a plot of power spectral density
- rc - control the default params
- savefig - save the current figure
- scatter - make a scatter plot
- set - set a handle graphics property
- semilogx - log x axis
- semilogy - log y axis
- show - show the figures
- specgram - a spectrogram plot
- stem - make a stem plot
- subplot - make a subplot (numrows, numcols, axesnum)
- table - add a table to the plot
- text - add some text at location x,y to the current axes
- title - add a title to the current axes
- xlim - set/get the xlimits
- ylim - set/get the ylimits
- xticks - set/get the xticks
- yticks - set/get the yticks
- xlabel - add an xlabel to the current axes
- ylabel - add a ylabel to the current axes
+ ipython -pylab
 
-Matrix commands
+For the most part, direct use of the object-oriented library
+is encouraged when programming rather than working
+interactively. The exceptions are the pylab commands
+figure(), subplot(), show(), and savefig(), which can
+greatly simplify scripting.
 
- cumprod - the cumulative product along a dimension
- cumsum - the cumulative sum along a dimension
- detrend - remove the mean or besdt fit line from an array
- diag - the k-th diagonal of matrix
- diff - the n-th differnce of an array
- eig - the eigenvalues and eigen vectors of v
- eye - a matrix where the k-th diagonal is ones, else zero
- find - return the indices where a condition is nonzero
- fliplr - flip the rows of a matrix up/down
- flipud - flip the columns of a matrix left/right
- linspace - a linear spaced vector of N values from min to max inclusive
- ones - an array of ones
- rand - an array from the uniform distribution [0,1]
- randn - an array from the normal distribution
- rot90 - rotate matrix k*90 degress counterclockwise
- squeeze - squeeze an array removing any dimensions of length 1
- tri - a triangular matrix
- tril - a lower triangular matrix
- triu - an upper triangular matrix
- vander - the Vandermonde matrix of vector x
- svd - singular value decomposition
- zeros - a matrix of zeros
+Modules include:
+ axes: defines the Axes class. Most pylab commands are
+ wrappers for Axes methods. The axes module is the
+ highest level of OO access to the library.
+ figure: defines Figure class.
+ artist: defines the Artist base class for all classes
+ that draw things.
+ line: defines Line2D class for drawing lines and markers
+ patches: defines classes for drawing polygons
+ text: defines Text, TextWithDash, and Annotate classes
+ image: defines AxesImage and FigureImage classes
+ collections: classes for efficient drawing of groups of
+ lines or polygons
+ colors: classes for interpreting color specifications
+ and for making colormaps
+ cm: colormaps and the ScalarMappable mixin class for
+ providing color mapping functionality to other
+ classes
+ ticker: classes for calculating tick mark locations and
+ for formatting tick labels
+ backends: a subpackage with modules for various gui
+ libraries and output formats
 
-Probability
+The base matplotlib namespace includes:
+ rcParams: a dictionary of default configuration
+ settings. It is initialized by code which may be
+ overridded by a matplotlibrc file.
+ rc(): a function for setting groups of rcParams values
+ use(): a function for setting the matplotlib backend.
+ If used, this function must be called immediately
+ after importing matplotlib for the first time. In
+ particular, it must be called *before* importing
+ pylab (if pylab is imported).
 
- levypdf - The levy probability density function from the char. func.
- normpdf - The Gaussian probability density function
- rand - random numbers from the uniform distribution
- randn - random numbers from the normal distribution
-
-Statistics
-
- corrcoef - correlation coefficient
- cov - covariance matrix
- max - the maximum along dimension m
- mean - the mean along dimension m
- median - the median along dimension m
- min - the minimum along dimension m
- norm - the norm of vector x
- prod - the product along dimension m
- ptp - the max-min along dimension m
- std - the standard deviation along dimension m
- sum - the sum along dimension m
-
-Time series analysis
-
- bartlett - M-point Bartlett window
- blackman - M-point Blackman window
- cohere - the coherence using average periodiogram
- csd - the cross spectral density using average periodiogram
- fft - the fast Fourier transform of vector x
- hamming - M-point Hamming window
- hanning - M-point Hanning window
- hist - compute the histogram of x
- kaiser - M length Kaiser window
- psd - the power spectral density using average periodiogram
- sinc - the sinc function of array x
-
-Other
-
- angle - the angle of a complex array
- polyfit - fit x, y to an n-th order polynomial
- polyval - evaluate an n-th order polynomial
- roots - the roots of the polynomial coefficients in p
- trapz - trapezoidal integration
-
-
-Credits: The plotting commands were provided by
-John D. Hunter <jdh...@ac...>
-
-Most of the other commands are from the Numeric, MLab and FFT, with
-the exception of those in mlab.py provided by matplotlib.
+matplotlib is written by John D. Hunter (jdh2358 at
+gmail.com).
 """
 from __future__ import generators
 
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 3534
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3534&view=rev
Author: pkienzle
Date: 2007年07月15日 19:16:22 -0700 (2007年7月15日)
Log Message:
-----------
Don't release mouse unless it is captured
Modified Paths:
--------------
 trunk/matplotlib/lib/matplotlib/backends/backend_wx.py
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_wx.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_wx.py	2007年07月16日 00:40:38 UTC (rev 3533)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_wx.py	2007年07月16日 02:16:22 UTC (rev 3534)
@@ -1177,7 +1177,7 @@
 x = evt.GetX()
 y = self.figure.bbox.height() - evt.GetY()
 evt.Skip()
- self.ReleaseMouse()
+ if self.HasCapture(): self.ReleaseMouse()
 FigureCanvasBase.button_release_event(self, x, y, 3, guiEvent=evt)
 
 def _onLeftButtonDown(self, evt):
@@ -1194,7 +1194,7 @@
 y = self.figure.bbox.height() - evt.GetY()
 #print 'release button', 1
 evt.Skip()
- self.ReleaseMouse()
+ if self.HasCapture(): self.ReleaseMouse()
 FigureCanvasBase.button_release_event(self, x, y, 1, guiEvent=evt)
 
 def _onMouseWheel(self, evt):
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <ef...@us...> - 2007年07月16日 00:40:44
Revision: 3533
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3533&view=rev
Author: efiring
Date: 2007年07月15日 17:40:38 -0700 (2007年7月15日)
Log Message:
-----------
Improved docstrings, mainly annotate, base pylab
Modified Paths:
--------------
 trunk/matplotlib/lib/matplotlib/__init__.py
 trunk/matplotlib/lib/matplotlib/artist.py
 trunk/matplotlib/lib/matplotlib/axes.py
 trunk/matplotlib/lib/matplotlib/cbook.py
 trunk/matplotlib/lib/matplotlib/pylab.py
 trunk/matplotlib/lib/matplotlib/text.py
 trunk/matplotlib/lib/pylab.py
Modified: trunk/matplotlib/lib/matplotlib/__init__.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/__init__.py	2007年07月15日 15:33:02 UTC (rev 3532)
+++ trunk/matplotlib/lib/matplotlib/__init__.py	2007年07月16日 00:40:38 UTC (rev 3533)
@@ -1,5 +1,5 @@
 """
-This is a matlab(TM) style functional interface the matplotlib.
+This is an object-orient plotting library.
 
 The following matlab(TM) compatible commands are provided by
 
@@ -901,4 +901,4 @@
 basemod = __import__(wholename)
 mod = getattr(basemod, name)
 setattr(self, name, mod)
- 
+
Modified: trunk/matplotlib/lib/matplotlib/artist.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/artist.py	2007年07月15日 15:33:02 UTC (rev 3532)
+++ trunk/matplotlib/lib/matplotlib/artist.py	2007年07月16日 00:40:38 UTC (rev 3533)
@@ -136,19 +136,19 @@
 if hasattr(self,'get_children'):
 for a in self.get_children(): L.extend(a.hitlist(event))
 return L
- 
+
 def contains(self,mouseevent):
- """Test whether the artist contains the mouse event. 
- 
- Returns the truth value and a dictionary of artist specific details of 
- selection, such as which points are contained in the pick radius. See 
+ """Test whether the artist contains the mouse event.
+
+ Returns the truth value and a dictionary of artist specific details of
+ selection, such as which points are contained in the pick radius. See
 individual artists for details.
 """
 if callable(self._contains): return self._contains(self,mouseevent)
 #raise NotImplementedError,str(self.__class__)+" needs 'contains' method"
 print str(self.__class__)+" needs 'contains' method"
 return False,{}
- 
+
 def set_contains(self,picker):
 """Replace the contains test used by this artist. The new picker should
 be a callable function which determines whether the artist is hit by the
@@ -156,7 +156,7 @@
 
 hit, props = picker(artist, mouseevent)
 
- If the mouse event is over the artist, return hit=True and props 
+ If the mouse event is over the artist, return hit=True and props
 is a dictionary of properties you want returned with the contains test.
 """
 self._contains = picker
@@ -680,7 +680,7 @@
 return [x for x in flatten(ret)]
 
 def kwdoc(a):
- return '\n'.join(ArtistInspector(a).pprint_setters(leadingspace=8))
+ return '\n'.join(ArtistInspector(a).pprint_setters(leadingspace=4))
 
 kwdocd = dict()
 kwdocd['Artist'] = kwdoc(Artist)
Modified: trunk/matplotlib/lib/matplotlib/axes.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axes.py	2007年07月15日 15:33:02 UTC (rev 3532)
+++ trunk/matplotlib/lib/matplotlib/axes.py	2007年07月16日 00:40:38 UTC (rev 3533)
@@ -9,8 +9,8 @@
 rcParams = matplotlib.rcParams
 
 # import a bunch of matplotlib modules into a single namespace
-mpl = matplotlib.Importer("""artist, agg, axis, cbook, collections, colors, 
- contour, dates, font_manager, image, legend, lines, mlab, cm, 
+mpl = matplotlib.Importer("""artist, agg, axis, cbook, collections, colors,
+ contour, dates, font_manager, image, legend, lines, mlab, cm,
 patches, quiver, table, text, ticker, transforms""")
 
 def delete_masked_points(*args):
@@ -2136,10 +2136,11 @@
 
 def annotate(self, *args, **kwargs):
 """
- annotate(self, s, xy, textloc,
- xycoords='data', textcoords='data',
- lineprops=None,
- markerprops=None
+ annotate(s, xy,
+ xytext=None,
+ xycoords='data',
+ textcoords='data',
+ arrowprops=None,
 **props)
 
 %(Annotation)s
@@ -4242,7 +4243,7 @@
 axes.fill(xs, ys, facecolor='red', alpha=0.5)
 
 See examples/fill_between.py for more examples.
- 
+
 kwargs control the Polygon properties:
 %(Polygon)s
 """
Modified: trunk/matplotlib/lib/matplotlib/cbook.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/cbook.py	2007年07月15日 15:33:02 UTC (rev 3532)
+++ trunk/matplotlib/lib/matplotlib/cbook.py	2007年07月16日 00:40:38 UTC (rev 3533)
@@ -546,7 +546,7 @@
 """
 if not s: # includes case of s is None
 return ''
- lines = s.splitlines(True)
+ lines = s.splitlines(False)
 ii = 0
 while lines[ii].strip() == '':
 ii += 1
@@ -555,7 +555,7 @@
 for i, line in enumerate(lines):
 nwhite = len(line) - len(line.lstrip())
 lines[i] = line[min(nshift, nwhite):]
- return ''.join(lines)
+ return '\n'.join(lines)
 
 
 
@@ -906,7 +906,7 @@
 outstream.write(repr(step))
 outstream.write(" ->\n")
 outstream.write("\n")
- 
+
 def recurse(obj, start, all, current_path):
 if show_progress:
 outstream.write("%d\r" % len(all))
@@ -923,7 +923,7 @@
 # Don't go back through the original list of objects, or
 # through temporary references to the object, since those
 # are just an artifact of the cycle detector itself.
- elif referent is objects or isinstance(referent, FrameType): 
+ elif referent is objects or isinstance(referent, FrameType):
 continue
 
 # We haven't seen this object before, so recurse
Modified: trunk/matplotlib/lib/matplotlib/pylab.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/pylab.py	2007年07月15日 15:33:02 UTC (rev 3532)
+++ trunk/matplotlib/lib/matplotlib/pylab.py	2007年07月16日 00:40:38 UTC (rev 3533)
@@ -1,9 +1,9 @@
 """
-This is a procedural interface to matplotlib.
+This is a procedural interface to the matplotlib object-oriented
+plotting library.
 
-The following plotting commands are provided; some of these do not
-exist in matlab(TM) but have proven themselves to be useful nonetheless.
-The majority of them, however, have matlab analogs
+The following plotting commands are provided; the majority have
+Matlab(TM) analogs and similar argument.
 
 _Plotting commands
 acorr - plot the autocorrelation function
Modified: trunk/matplotlib/lib/matplotlib/text.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/text.py	2007年07月15日 15:33:02 UTC (rev 3532)
+++ trunk/matplotlib/lib/matplotlib/text.py	2007年07月16日 00:40:38 UTC (rev 3533)
@@ -94,36 +94,36 @@
 # class is build so we define an initial set here for the init
 # function and they will be overridden after object defn
 artist.kwdocd['Text'] = """\
- alpha: float
- animated: [True | False]
- backgroundcolor: any matplotlib color
- bbox: rectangle prop dict plus key 'pad' which is a pad in points
- clip_box: a matplotlib.transform.Bbox instance
- clip_on: [True | False]
- color: any matplotlib color
- family: [ 'serif' | 'sans-serif' | 'cursive' | 'fantasy' | 'monospace' ]
- figure: a matplotlib.figure.Figure instance
- fontproperties: a matplotlib.font_manager.FontProperties instance
- horizontalalignment or ha: [ 'center' | 'right' | 'left' ]
- label: any string
- linespacing: float
- lod: [True | False]
- multialignment: ['left' | 'right' | 'center' ]
- name or fontname: string eg, ['Sans' | 'Courier' | 'Helvetica' ...]
- position: (x,y)
- rotation: [ angle in degrees 'vertical' | 'horizontal'
- size or fontsize: [ size in points | relative size eg 'smaller', 'x-large' ]
- style or fontstyle: [ 'normal' | 'italic' | 'oblique']
- text: string
- transform: a matplotlib.transform transformation instance
- variant: [ 'normal' | 'small-caps' ]
- verticalalignment or va: [ 'center' | 'top' | 'bottom' ]
- visible: [True | False]
- weight or fontweight: [ 'normal' | 'bold' | 'heavy' | 'light' | 'ultrabold' | 'ultralight']
- x: float
- y: float
- zorder: any number
- """
+ alpha: float
+ animated: [True | False]
+ backgroundcolor: any matplotlib color
+ bbox: rectangle prop dict plus key 'pad' which is a pad in points
+ clip_box: a matplotlib.transform.Bbox instance
+ clip_on: [True | False]
+ color: any matplotlib color
+ family: [ 'serif' | 'sans-serif' | 'cursive' | 'fantasy' | 'monospace' ]
+ figure: a matplotlib.figure.Figure instance
+ fontproperties: a matplotlib.font_manager.FontProperties instance
+ horizontalalignment or ha: [ 'center' | 'right' | 'left' ]
+ label: any string
+ linespacing: float
+ lod: [True | False]
+ multialignment: ['left' | 'right' | 'center' ]
+ name or fontname: string eg, ['Sans' | 'Courier' | 'Helvetica' ...]
+ position: (x,y)
+ rotation: [ angle in degrees 'vertical' | 'horizontal'
+ size or fontsize: [ size in points | relative size eg 'smaller', 'x-large' ]
+ style or fontstyle: [ 'normal' | 'italic' | 'oblique']
+ text: string
+ transform: a matplotlib.transform transformation instance
+ variant: [ 'normal' | 'small-caps' ]
+ verticalalignment or va: [ 'center' | 'top' | 'bottom' ]
+ visible: [True | False]
+ weight or fontweight: [ 'normal' | 'bold' | 'heavy' | 'light' | 'ultrabold' | 'ultralight']
+ x: float
+ y: float
+ zorder: any number
+ """
 
 class Text(Artist):
 """
@@ -149,8 +149,10 @@
 **kwargs
 ):
 """
- Create a Text instance at x,y with string text. Valid kwargs are
- %(Text)s
+ Create a Text instance at x,y with string text.
+
+ Valid kwargs are
+ %(Text)s
 """
 
 Artist.__init__(self)
@@ -817,6 +819,7 @@
 
 return val
 
+artist.kwdocd['Text'] = artist.kwdoc(Text)
 
 
 class TextWithDash(Text):
@@ -1125,6 +1128,7 @@
 Text.set_figure(self, fig)
 self.dashline.set_figure(fig)
 
+artist.kwdocd['TextWithDash'] = artist.kwdoc(TextWithDash)
 
 class Annotation(Text):
 """
@@ -1134,8 +1138,8 @@
 def __str__(self):
 return "Annotation(%g,%g,%s)"%(self.xy[0],self.xy[1],self._text)
 def __init__(self, s, xy,
+ xytext=None,
 xycoords='data',
- xytext=None,
 textcoords=None,
 arrowprops=None,
 **kwargs):
@@ -1159,7 +1163,7 @@
 endpoints. ie, shrink=0.05 is 5%%
 - any key for matplotlib.patches.polygon
 
- xycoords and textcoords are a string that indicates the
+ xycoords and textcoords are strings that indicate the
 coordinates of xy and xytext.
 
 'figure points' : points from the lower left corner of the figure
@@ -1184,7 +1188,7 @@
 
 Additional kwargs are Text properties:
 
- %(Text)s
+ %(Text)s
 
 """
 if xytext is None:
@@ -1344,6 +1348,4 @@
 Text.draw(self, renderer)
 
 
-artist.kwdocd['Text'] = artist.kwdoc(Text)
-artist.kwdocd['TextWithDash'] = artist.kwdoc(TextWithDash)
-artist.kwdocd['Annotation'] = artist.kwdoc(Annotation)
+artist.kwdocd['Annotation'] = Annotation.__init__.__doc__
Modified: trunk/matplotlib/lib/pylab.py
===================================================================
--- trunk/matplotlib/lib/pylab.py	2007年07月15日 15:33:02 UTC (rev 3532)
+++ trunk/matplotlib/lib/pylab.py	2007年07月16日 00:40:38 UTC (rev 3533)
@@ -1 +1,3 @@
 from matplotlib.pylab import *
+import matplotlib.pylab
+__doc__ = matplotlib.pylab.__doc__
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <jd...@us...> - 2007年07月15日 15:33:10
Revision: 3532
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3532&view=rev
Author: jdh2358
Date: 2007年07月15日 08:33:02 -0700 (2007年7月15日)
Log Message:
-----------
added agg buffer to numpy array example
Modified Paths:
--------------
 trunk/matplotlib/lib/matplotlib/backends/backend_agg.py
 trunk/matplotlib/lib/matplotlib/image.py
Added Paths:
-----------
 trunk/matplotlib/examples/agg_buffer_to_array.py
Added: trunk/matplotlib/examples/agg_buffer_to_array.py
===================================================================
--- trunk/matplotlib/examples/agg_buffer_to_array.py	 (rev 0)
+++ trunk/matplotlib/examples/agg_buffer_to_array.py	2007年07月15日 15:33:02 UTC (rev 3532)
@@ -0,0 +1,24 @@
+import matplotlib
+matplotlib.use('Agg')
+from pylab import figure, show
+import numpy as npy
+
+# make an agg figure
+fig = figure()
+ax = fig.add_subplot(111)
+ax.plot([1,2,3])
+ax.set_title('a simple figure')
+fig.canvas.draw()
+
+# grab rhe pixel buffer and dumpy it into a numpy array
+buf = fig.canvas.buffer_rgba(0,0)
+l, b, w, h = fig.bbox.get_bounds()
+X = npy.fromstring(buf, npy.uint8)
+X.shape = h,w,4
+
+# now display the array X as an Axes in a new figure
+fig2 = figure()
+ax2 = fig2.add_subplot(111, frameon=False)
+ax2.imshow(X)
+fig2.savefig('simple.png')
+show()
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_agg.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_agg.py	2007年07月15日 05:08:57 UTC (rev 3531)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_agg.py	2007年07月15日 15:33:02 UTC (rev 3532)
@@ -382,8 +382,8 @@
 """
 if __debug__: verbose.report('FigureCanvasAgg.draw', 'debug-annoying')
 
- renderer = self.get_renderer()
- self.figure.draw(renderer)
+ self.renderer = self.get_renderer()
+ self.figure.draw(self.renderer)
 
 def get_renderer(self):
 l,b,w,h = self.figure.bbox.get_bounds()
Modified: trunk/matplotlib/lib/matplotlib/image.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/image.py	2007年07月15日 05:08:57 UTC (rev 3531)
+++ trunk/matplotlib/lib/matplotlib/image.py	2007年07月15日 15:33:02 UTC (rev 3532)
@@ -264,7 +264,9 @@
 if self._extent is not None:
 return self._extent
 else:
- numrows, numcols = self.get_size()
+ sz = self.get_size()
+ #print 'sz', sz
+ numrows, numcols = sz
 if self.origin == 'upper':
 return (-0.5, numcols-0.5, numrows-0.5, -0.5)
 else:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.

Showing results of 5455

<< < 1 .. 217 218 219 (Page 219 of 219)
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /