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
|
|
From: <md...@us...> - 2008-06-24 17:37:31
|
Revision: 5661
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5661&view=rev
Author: mdboom
Date: 2008-06-24 10:36:44 -0700 (Tue, 24 Jun 2008)
Log Message:
-----------
Docstring formatting fixes.
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/patches.py
Modified: trunk/matplotlib/lib/matplotlib/patches.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/patches.py 2008-06-24 17:35:57 UTC (rev 5660)
+++ trunk/matplotlib/lib/matplotlib/patches.py 2008-06-24 17:36:44 UTC (rev 5661)
@@ -153,7 +153,7 @@
def get_linewidth(self):
return self._linewidth
get_lw = get_linewidth
-
+
def get_linestyle(self):
return self._linestyle
get_ls = get_linestyle
@@ -197,7 +197,7 @@
if w is None: w = mpl.rcParams['patch.linewidth']
self._linewidth = w
set_lw = set_linewidth
-
+
def set_linestyle(self, ls):
"""
Set the patch linestyle
@@ -645,6 +645,7 @@
self.theta2 = theta2
self._patch_transform = transforms.IdentityTransform()
self._path = Path.wedge(self.theta1, self.theta2)
+ __init__.__doc__ = cbook.dedent(__init__.__doc__) % artist.kwdocd
def get_path(self):
return self._path
@@ -931,6 +932,7 @@
self._path = Path.unit_circle()
self._patch_transform = transforms.IdentityTransform()
self._recompute_transform()
+ __init__.__doc__ = cbook.dedent(__init__.__doc__) % artist.kwdocd
def _recompute_transform(self):
center = (self.convert_xunits(self.center[0]),
@@ -1037,6 +1039,7 @@
self.theta1 = theta1
self.theta2 = theta2
+ __init__.__doc__ = cbook.dedent(__init__.__doc__) % artist.kwdocd
def draw(self, renderer):
"""
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-06-24 17:36:51
|
Revision: 5660
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5660&view=rev
Author: mdboom
Date: 2008-06-24 10:35:57 -0700 (Tue, 24 Jun 2008)
Log Message:
-----------
Minor comments fixes.
Modified Paths:
--------------
trunk/matplotlib/doc/sphinxext/inheritance_diagram.py
Modified: trunk/matplotlib/doc/sphinxext/inheritance_diagram.py
===================================================================
--- trunk/matplotlib/doc/sphinxext/inheritance_diagram.py 2008-06-24 17:35:33 UTC (rev 5659)
+++ trunk/matplotlib/doc/sphinxext/inheritance_diagram.py 2008-06-24 17:35:57 UTC (rev 5660)
@@ -140,8 +140,8 @@
def class_name(self, cls, parts=0):
"""
Given a class object, return a fully-qualified name. This
- works for things I've tested in matplotlib so far, but may
- not be completely general.
+ works for things I've tested in matplotlib so far, but may not
+ be completely general.
"""
module = cls.__module__
if module == '__builtin__':
@@ -158,7 +158,7 @@
"""
return [self.class_name(x) for x in self.all_classes]
- # These are the default options for
+ # These are the default options for graphviz
default_graph_options = {
"rankdir": "LR",
"size": '"8.0, 12.0"'
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-06-24 17:35:42
|
Revision: 5659
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5659&view=rev
Author: mdboom
Date: 2008-06-24 10:35:33 -0700 (Tue, 24 Jun 2008)
Log Message:
-----------
Add "transparent" kwarg to savefig to save figure without figure or axes patches.
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/figure.py
Modified: trunk/matplotlib/lib/matplotlib/figure.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/figure.py 2008-06-24 16:32:23 UTC (rev 5658)
+++ trunk/matplotlib/lib/matplotlib/figure.py 2008-06-24 17:35:33 UTC (rev 5659)
@@ -972,7 +972,8 @@
call signature::
savefig(fname, dpi=None, facecolor='w', edgecolor='w',
- orientation='portrait', papertype=None, format=None):
+ orientation='portrait', papertype=None, format=None,
+ transparent=False):
Save the current figure.
@@ -1006,14 +1007,36 @@
*format*:
One of the file extensions supported by the active
backend. Most backends support png, pdf, ps, eps and svg.
+
+ *transparent*:
+ If *True*, the figure patch and axes patches will all be
+ transparent. This is useful, for example, for displaying
+ a plot on top of a colored background on a web page. The
+ transparency of these patches will be restored to their
+ original values upon exit of this function.
"""
for key in ('dpi', 'facecolor', 'edgecolor'):
if not kwargs.has_key(key):
kwargs[key] = rcParams['savefig.%s'%key]
+ transparent = kwargs.pop('transparent', False)
+ if transparent:
+ original_figure_alpha = self.figurePatch.get_alpha()
+ self.figurePatch.set_alpha(0.0)
+ original_axes_alpha = []
+ for ax in self.axes:
+ axesPatch = ax.get_frame()
+ original_axes_alpha.append(axesPatch.get_alpha())
+ axesPatch.set_alpha(0.0)
+
self.canvas.print_figure(*args, **kwargs)
+ if transparent:
+ self.figurePatch.set_alpha(original_figure_alpha)
+ for ax, alpha in zip(self.axes, original_axes_alpha):
+ ax.get_frame().set_alpha(alpha)
+
def colorbar(self, mappable, cax=None, ax=None, **kw):
if ax is None:
ax = self.gca()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-06-24 16:32:33
|
Revision: 5658
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5658&view=rev
Author: jdh2358
Date: 2008-06-24 09:32:23 -0700 (Tue, 24 Jun 2008)
Log Message:
-----------
removed plain vnilla wx example; use wxagg instead
Modified Paths:
--------------
trunk/matplotlib/examples/user_interfaces/embedding_in_wx2.py
Removed Paths:
-------------
trunk/matplotlib/examples/user_interfaces/embedding_in_wx.py
Deleted: trunk/matplotlib/examples/user_interfaces/embedding_in_wx.py
===================================================================
--- trunk/matplotlib/examples/user_interfaces/embedding_in_wx.py 2008-06-24 16:28:10 UTC (rev 5657)
+++ trunk/matplotlib/examples/user_interfaces/embedding_in_wx.py 2008-06-24 16:32:23 UTC (rev 5658)
@@ -1,99 +0,0 @@
-#!/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
-
-This is a sample showing how to embed a matplotlib figure in a wxPanel.
-
-The example implements the full navigation toolbar, so you can automatically
-inherit standard matplotlib features such as the ability to zoom, pan and
-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.
-"""
-
-from matplotlib.backends.backend_wx import Toolbar, FigureCanvasWx,\
- FigureManager
-
-from matplotlib.figure import Figure
-import numpy
-from wx import *
-
-
-
-class PlotFigure(Frame):
- def __init__(self):
- Frame.__init__(self, None, -1, "Test embedded wxFigure")
-
- self.fig = Figure((9,8), 75)
- self.canvas = FigureCanvasWx(self, -1, self.fig)
- self.toolbar = Toolbar(self.canvas)
- self.toolbar.Realize()
-
- # On Windows, default frame size behaviour is incorrect
- # you don't need this under Linux
- tw, th = self.toolbar.GetSizeTuple()
- fw, fh = self.canvas.GetSizeTuple()
- self.toolbar.SetSize(Size(fw, th))
-
- # Create a figure manager to manage things
- self.figmgr = FigureManager(self.canvas, 1, self)
- # Now put all into a sizer
- sizer = BoxSizer(VERTICAL)
- # This way of adding to sizer allows resizing
- sizer.Add(self.canvas, 1, LEFT|TOP|GROW)
- # Best to allow the toolbar to resize!
- sizer.Add(self.toolbar, 0, GROW)
- self.SetSizer(sizer)
- self.Fit()
-
- 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)
- a.plot(t,s)
- a.plot(t,c)
- self.toolbar.update()
-
- def GetToolBar(self):
- # You will need to override GetToolBar if you are using an
- # unmanaged toolbar in your frame
- return self.toolbar
-
-if __name__ == '__main__':
- app = PySimpleApp(0)
- frame = PlotFigure()
- frame.plot_data()
- frame.Show()
- app.MainLoop()
Modified: trunk/matplotlib/examples/user_interfaces/embedding_in_wx2.py
===================================================================
--- trunk/matplotlib/examples/user_interfaces/embedding_in_wx2.py 2008-06-24 16:28:10 UTC (rev 5657)
+++ trunk/matplotlib/examples/user_interfaces/embedding_in_wx2.py 2008-06-24 16:32:23 UTC (rev 5658)
@@ -15,6 +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_wx import NavigationToolbar2Wx
from matplotlib.figure import Figure
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-06-24 16:28:46
|
Revision: 5657
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5657&view=rev
Author: jdh2358
Date: 2008-06-24 09:28:10 -0700 (Tue, 24 Jun 2008)
Log Message:
-----------
support string names for csv2rec
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/mlab.py
Modified: trunk/matplotlib/lib/matplotlib/mlab.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/mlab.py 2008-06-24 14:37:41 UTC (rev 5656)
+++ trunk/matplotlib/lib/matplotlib/mlab.py 2008-06-24 16:28:10 UTC (rev 5657)
@@ -2381,6 +2381,10 @@
names.append(item)
seen[item] = cnt+1
+ else:
+ if cbook.is_string_like(names):
+ names = [n.strip() for n in names.split(',')]
+
# get the converter functions by inspecting checkrows
converters = get_converters(reader)
if converters is None:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-06-24 14:37:44
|
Revision: 5656
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5656&view=rev
Author: jdh2358
Date: 2008-06-24 07:37:41 -0700 (Tue, 24 Jun 2008)
Log Message:
-----------
fixed a date autolocator refresh bug
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/axes.py
Modified: trunk/matplotlib/lib/matplotlib/axes.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axes.py 2008-06-24 13:56:55 UTC (rev 5655)
+++ trunk/matplotlib/lib/matplotlib/axes.py 2008-06-24 14:37:41 UTC (rev 5656)
@@ -2058,7 +2058,8 @@
*tz* is the time zone to use in labeling dates. Defaults to rc value.
"""
- if self.ignore_existing_data_limits:
+ xmin, xmax = self.dataLim.intervalx
+ if xmin==0.:
# no data has been added - let's set the default datalim.
# We should probably use a better proxy for the datalim
# have been updated than the ignore setting
@@ -2074,6 +2075,12 @@
locator = mdates.AutoDateLocator(tz)
self.xaxis.set_major_locator(locator)
+ # the autolocator uses the viewlim to pick the right date
+ # locator, but it may not have correct viewlim before an
+ # autoscale. If the viewlim is still zero..1, set it to the
+ # datalim and the autoscaler will update it on request
+ if self.viewLim.intervalx[0]==0.:
+ self.viewLim.intervalx = tuple(self.dataLim.intervalx)
locator.refresh()
formatter = self.xaxis.get_major_formatter()
@@ -2086,7 +2093,8 @@
*tz* is the time zone to use in labeling dates. Defaults to rc value.
"""
- if self.ignore_existing_data_limits:
+ ymin, ymax = self.dataLim.intervaly
+ if ymin==0.:
# no data has been added - let's set the default datalim.
# We should probably use a better proxy for the datalim
# have been updated than the ignore setting
@@ -2103,6 +2111,13 @@
if not isinstance(locator, mdates.DateLocator):
locator = mdates.AutoDateLocator(tz)
self.yaxis.set_major_locator(locator)
+
+ # the autolocator uses the viewlim to pick the right date
+ # locator, but it may not have correct viewlim before an
+ # autoscale. If the viewlim is still zero..1, set it to the
+ # datalim and the autoscaler will update it on request
+ if self.viewLim.intervaly[0]==0.:
+ self.viewLim.intervaly = tuple(self.dataLim.intervaly)
locator.refresh()
formatter = self.xaxis.get_major_formatter()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-06-24 13:56:57
|
Revision: 5655
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5655&view=rev
Author: jdh2358
Date: 2008-06-24 06:56:55 -0700 (Tue, 24 Jun 2008)
Log Message:
-----------
removed idle support from tkagg until I figure out interrupts
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/backends/backend_qt4.py
trunk/matplotlib/lib/matplotlib/backends/backend_tkagg.py
trunk/matplotlib/lib/matplotlib/legend.py
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_qt4.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_qt4.py 2008-06-24 12:26:43 UTC (rev 5654)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_qt4.py 2008-06-24 13:56:55 UTC (rev 5655)
@@ -7,7 +7,7 @@
from matplotlib import verbose
from matplotlib.cbook import is_string_like, onetrue
from matplotlib.backend_bases import RendererBase, GraphicsContextBase, \
- FigureManagerBase, FigureCanvasBase, NavigationToolbar2, cursors
+ FigureManagerBase, FigureCanvasBase, NavigationToolbar2, IdleEvent, cursors
from matplotlib._pylab_helpers import Gcf
from matplotlib.figure import Figure
from matplotlib.mathtext import MathTextParser
@@ -94,10 +94,15 @@
FigureCanvasBase.__init__( self, figure )
self.figure = figure
self.setMouseTracking( True )
-
+ # hide until we can test and fix
+ #self.startTimer(backend_IdleEvent.milliseconds)
w,h = self.get_width_height()
self.resize( w, h )
+ def __timerEvent(self, event):
+ # hide until we can test and fix
+ self.mpl_idle_event(event)
+
def mousePressEvent( self, event ):
x = event.pos().x()
# flipy so y=0 is bottom of canvas
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_tkagg.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_tkagg.py 2008-06-24 12:26:43 UTC (rev 5654)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_tkagg.py 2008-06-24 13:56:55 UTC (rev 5655)
@@ -178,9 +178,10 @@
def on_idle(*ignore):
self.idle_event()
return True
- t = cbook.Idle(on_idle)
- self._tkcanvas.after_idle(lambda *ignore: t.start())
+ # disable until you figure out how to handle threads and interrupts
+ #t = cbook.Idle(on_idle)
+ #self._tkcanvas.after_idle(lambda *ignore: t.start())
def resize(self, event):
width, height = event.width, event.height
Modified: trunk/matplotlib/lib/matplotlib/legend.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/legend.py 2008-06-24 12:26:43 UTC (rev 5654)
+++ trunk/matplotlib/lib/matplotlib/legend.py 2008-06-24 13:56:55 UTC (rev 5655)
@@ -271,7 +271,7 @@
legline_marker.set_linestyle('None')
self._set_artist_props(legline_marker)
# we don't want to add this to the return list because
- # the texts and handles are assumed to be in one to ne
+ # the texts and handles are assumed to be in one-to-one
# correpondence.
legline._legmarker = legline_marker
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-06-24 12:26:47
|
Revision: 5654
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5654&view=rev
Author: jdh2358
Date: 2008-06-24 05:26:43 -0700 (Tue, 24 Jun 2008)
Log Message:
-----------
added stefan's numpoints=1 marker patch
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
trunk/matplotlib/lib/matplotlib/legend.py
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2008-06-24 04:17:21 UTC (rev 5653)
+++ trunk/matplotlib/CHANGELOG 2008-06-24 12:26:43 UTC (rev 5654)
@@ -1,3 +1,6 @@
+2006-08-24 Applied Stefan's patch to draw a sinle centered marker over
+ a line with numpoints==1 - JDH
+
2008-06-23 Use splines to render circles in scatter plots - MGD
===============================================================
Modified: trunk/matplotlib/lib/matplotlib/legend.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/legend.py 2008-06-24 04:17:21 UTC (rev 5653)
+++ trunk/matplotlib/lib/matplotlib/legend.py 2008-06-24 12:26:43 UTC (rev 5654)
@@ -27,7 +27,7 @@
from matplotlib import rcParams
from artist import Artist
-from cbook import is_string_like, iterable, silent_list
+from cbook import is_string_like, iterable, silent_list, safezip
from font_manager import FontProperties
from lines import Line2D
from mlab import segments_intersect
@@ -118,7 +118,7 @@
proplist=[numpoints, pad, markerscale, labelsep, handlelen, handletextsep, axespad, shadow]
propnames=['numpoints', 'pad', 'markerscale', 'labelsep', 'handlelen', 'handletextsep', 'axespad', 'shadow']
- for name, value in zip(propnames,proplist):
+ for name, value in safezip(propnames,proplist):
if value is None:
value=rcParams["legend."+name]
setattr(self,name,value)
@@ -206,6 +206,8 @@
for h in self.legendHandles:
if h is not None:
h.draw(renderer)
+ if hasattr(h, '_legmarker'):
+ h._legmarker.draw(renderer)
if 0: bbox_artist(h, renderer)
for t in self.texts:
@@ -233,31 +235,46 @@
return ibox
def _get_handles(self, handles, texts):
+ handles = list(handles)
+ texts = list(texts)
HEIGHT = self._approx_text_height()
left = 0.5
ret = [] # the returned legend lines
- for handle, label in zip(handles, texts):
+ # we need to pad the text with empties for the numpoints=1
+ # centered marker proxy
+
+ for handle, label in safezip(handles, texts):
if self.numpoints > 1:
xdata = np.linspace(left, left + self.handlelen, self.numpoints)
+ xdata_marker = xdata
elif self.numpoints == 1:
xdata = np.linspace(left, left + self.handlelen, 2)
+ xdata_marker = [left + 0.5*self.handlelen]
x, y = label.get_position()
x -= self.handlelen + self.handletextsep
if isinstance(handle, Line2D):
- if self.numpoints == 1 and handle._marker != 'None':
- xdata = np.array([left + self.handlelen*0.5])
ydata = (y-HEIGHT/2)*np.ones(xdata.shape, float)
legline = Line2D(xdata, ydata)
+
legline.update_from(handle)
self._set_artist_props(legline) # after update
legline.set_clip_box(None)
legline.set_clip_path(None)
- legline.set_markersize(self.markerscale*legline.get_markersize())
+ ret.append(legline)
+ legline.set_marker('None')
- ret.append(legline)
+ legline_marker = Line2D(xdata_marker, ydata[:len(xdata_marker)])
+ legline_marker.update_from(handle)
+ legline_marker.set_linestyle('None')
+ self._set_artist_props(legline_marker)
+ # we don't want to add this to the return list because
+ # the texts and handles are assumed to be in one to ne
+ # correpondence.
+ legline._legmarker = legline_marker
+
elif isinstance(handle, Patch):
p = Rectangle(xy=(min(xdata), y-3/4*HEIGHT),
width = self.handlelen, height=HEIGHT/2,
@@ -477,7 +494,7 @@
return bboxa.bounds
hpos = []
- for t, tabove in zip(self.texts[1:], self.texts[:-1]):
+ for t, tabove in safezip(self.texts[1:], self.texts[:-1]):
x,y = t.get_position()
l,b,w,h = get_tbounds(tabove)
b -= self.labelsep
@@ -486,16 +503,18 @@
t.set_position( (x, b-0.1*h) )
# now do the same for last line
+
l,b,w,h = get_tbounds(self.texts[-1])
b -= self.labelsep
h += 2*self.labelsep
hpos.append( (b,h) )
- for handle, tup in zip(self.legendHandles, hpos):
+ for handle, tup in safezip(self.legendHandles, hpos):
y,h = tup
if isinstance(handle, Line2D):
ydata = y*np.ones(handle.get_xdata().shape, float)
- handle.set_ydata(ydata+h/2)
+ handle.set_ydata(ydata+h/2.)
+ handle._legmarker.set_ydata(ydata+h/2.)
elif isinstance(handle, Rectangle):
handle.set_y(y+1/4*h)
handle.set_height(h/2)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-06-24 04:17:24
|
Revision: 5653
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5653&view=rev
Author: jdh2358
Date: 2008-06-23 21:17:21 -0700 (Mon, 23 Jun 2008)
Log Message:
-----------
replaced idle handler with idle event
Modified Paths:
--------------
trunk/matplotlib/examples/event_handling/idle_and_timeout.py
trunk/matplotlib/lib/matplotlib/backend_bases.py
trunk/matplotlib/lib/matplotlib/backends/backend_gtk.py
trunk/matplotlib/lib/matplotlib/backends/backend_tkagg.py
trunk/matplotlib/lib/matplotlib/backends/backend_wx.py
trunk/matplotlib/lib/matplotlib/cbook.py
Modified: trunk/matplotlib/examples/event_handling/idle_and_timeout.py
===================================================================
--- trunk/matplotlib/examples/event_handling/idle_and_timeout.py 2008-06-23 21:39:11 UTC (rev 5652)
+++ trunk/matplotlib/examples/event_handling/idle_and_timeout.py 2008-06-24 04:17:21 UTC (rev 5653)
@@ -1,31 +1,43 @@
"""
Demonstrate/test the idle and timeout API
"""
+import numpy as np
import matplotlib.pyplot as plt
fig = plt.figure()
ax = fig.add_subplot(111)
-ax.plot(range(10))
+t = np.arange(0.0, 2.0, 0.01)
+y1 = np.sin(2*np.pi*t)
+y2 = np.cos(2*np.pi*t)
+line1, = ax.plot(y1)
+line2, = ax.plot(y2)
-def on_idle(canvas):
+N = 100
+def on_idle(event):
on_idle.count +=1
print 'idle', on_idle.count
- if on_idle.count==10:
- canvas.mpl_source_remove(on_idle)
- return True
+ line1.set_ydata(np.sin(2*np.pi*t*(N-on_idle.count)/float(N)))
+ event.canvas.draw()
+ # test boolean return removal
+ if on_idle.count==N:
+ fig.canvas.mpl_disconnect(on_idle.cid)
+on_idle.cid = None
on_idle.count = 0
def on_timeout(canvas):
on_timeout.count +=1
+ line2.set_ydata(np.cos(2*np.pi*t*(N-on_idle.count)/float(N)))
+ line2.figure.canvas.draw()
print 'timeout', on_timeout.count
- if on_timeout.count==10:
- canvas.mpl_source_remove(on_timeout)
+ # test explicit removal
+ if on_timeout.count==N:
+ return False
return True
on_timeout.count = 0
-fig.canvas.mpl_idle_add(on_idle)
-fig.canvas.mpl_timeout_add(100, on_timeout)
+on_idle.cid = fig.canvas.mpl_connect('idle_event', on_idle)
+#fig.canvas.mpl_timeout_add(100, on_timeout)
plt.show()
Modified: trunk/matplotlib/lib/matplotlib/backend_bases.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backend_bases.py 2008-06-23 21:39:11 UTC (rev 5652)
+++ trunk/matplotlib/lib/matplotlib/backend_bases.py 2008-06-24 04:17:21 UTC (rev 5653)
@@ -651,6 +651,12 @@
self.canvas = canvas
self.guiEvent = guiEvent
+class IdleEvent(Event):
+ """
+ An event triggered by the GUI backend when it is idel -- useful
+ for passive animation
+ """
+ pass
class DrawEvent(Event):
"""
@@ -869,7 +875,7 @@
A :class:`matplotlib.figure.Figure` instance
"""
- events = (
+ events = [
'resize_event',
'draw_event',
'key_press_event',
@@ -879,7 +885,8 @@
'scroll_event',
'motion_notify_event',
'pick_event',
- )
+ 'idle_event',
+ ]
def __init__(self, figure):
@@ -1122,6 +1129,13 @@
guiEvent=guiEvent)
self.callbacks.process(s, event)
+ def idle_event(self, guiEvent=None):
+ 'call when GUI is idle'
+ s = 'idle_event'
+ event = IdleEvent(s, self, guiEvent=guiEvent)
+ self.callbacks.process(s, event)
+
+
def draw(self, *args, **kwargs):
"""
Render the :class:`~matplotlib.figure.Figure`
@@ -1320,8 +1334,11 @@
"""
add func to idle handler. The signature of func is::
- func(canvas, *args, **kwargs)
+ b = func(canvas, *args, **kwargs)
+ The function will continue to be called until func returns
+ False or a call to ``canvas.mpl_remove_source(func)``
+
use :meth:`mpl_source_remove` to remove func from the idle handler.
"""
raise NotImplementedError('GUI backend must override')
@@ -1331,7 +1348,8 @@
add func to timeout handler; func will be called every
millisec. The signature of func is::
- func(canvas, *args, **kwargs)
+ The function will continue to be called until func returns
+ False or a call to ``canvas.mpl_remove_source(func)``
use :meth:`mpl_source_remove` to remove func from the timeout handler.
"""
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_gtk.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_gtk.py 2008-06-23 21:39:11 UTC (rev 5652)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_gtk.py 2008-06-24 04:17:21 UTC (rev 5653)
@@ -172,8 +172,7 @@
self.set_flags(gtk.CAN_FOCUS)
self._renderer_init()
- # maps idle/timeout func -> id, remove_func for later removal
- self.sourced = dict()
+ gobject.idle_add(self.idle_event)
def scroll_event(self, widget, event):
if _debug: print 'FigureCanvasGTK.%s' % fn_name()
@@ -397,52 +396,6 @@
gtk.gdk.threads_leave()
- def mpl_idle_add(self, func, *args, **kwargs):
- """
- add func to idle handler. The signature of func is::
-
- func(canvas, *args, **kwargs)
-
- use :meth:`mpl_source_remove` to remove func from the idle handler.
- """
- idle_add = getattr(gobject, 'idle_add', getattr(gtk, 'idle_add'))
- remove = getattr(gobject, 'source_remove', getattr(gtk, 'idle_remove'))
-
- def wrap():
- b = func(self, *args, **kwargs)
- return True
-
- id = idle_add(wrap)
- self.sourced[func] = id, remove
-
-
- def mpl_timeout_add(self, millisec, func, *args, **kwargs):
- """
- add func to timeout handler; func will be called every
- millisec. The signature of func is::
-
- func(canvas, *args, **kwargs)
-
- use :meth:`mpl_source_remove` to remove func from the timeout handler.
- """
- timeout_add = getattr(gobject, 'timeout_add', getattr(gtk, 'timeout_add'))
- remove = getattr(gobject, 'source_remove', getattr(gtk, 'timeout_remove'))
- def wrap():
- b = func(self, *args, **kwargs)
- return True
-
- id = timeout_add(millisec, wrap)
- self.sourced[func] = id, remove
-
-
- def mpl_source_remove(self, func):
- """
- remove func from idle or timeout handler
- """
- id, remove = self.sourced[func]
- remove(id)
- del self.sourced[func]
-
class FigureManagerGTK(FigureManagerBase):
"""
Public attributes
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_tkagg.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_tkagg.py 2008-06-23 21:39:11 UTC (rev 5652)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_tkagg.py 2008-06-24 04:17:21 UTC (rev 5653)
@@ -21,6 +21,8 @@
import matplotlib.windowing as windowing
from matplotlib.widgets import SubplotTool
+import matplotlib.cbook as cbook
+
rcParams = matplotlib.rcParams
verbose = matplotlib.verbose
@@ -38,6 +40,7 @@
cursors.SELECT_REGION: "tcross",
}
+
def round(x):
return int(math.floor(x+0.5))
@@ -168,7 +171,17 @@
self._master = master
self._tkcanvas.focus_set()
+ # a dict from func-> cbook.Scheduler threads
+ self.sourced = dict()
+ # call the idle handler
+ def on_idle(*ignore):
+ self.idle_event()
+ return True
+ t = cbook.Idle(on_idle)
+
+ self._tkcanvas.after_idle(lambda *ignore: t.start())
+
def resize(self, event):
width, height = event.width, event.height
if self._resize_callback is not None:
@@ -221,6 +234,7 @@
y = self.figure.bbox.height - event.y
FigureCanvasBase.motion_notify_event(self, x, y, guiEvent=event)
+
def button_press_event(self, event):
x = event.x
# flipy so y=0 is bottom of canvas
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_wx.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_wx.py 2008-06-23 21:39:11 UTC (rev 5652)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_wx.py 2008-06-24 04:17:21 UTC (rev 5653)
@@ -713,6 +713,7 @@
self.Bind(wx.EVT_LEFT_UP, self._onLeftButtonUp)
self.Bind(wx.EVT_MOTION, self._onMotion)
self.Bind(wx.EVT_LEAVE_WINDOW, self._onLeave)
+ self.Bind(wx.EVT_IDLE, self._onIdle)
else:
# Event handlers 2.4
wx.EVT_SIZE(self, self._onSize)
@@ -728,6 +729,7 @@
wx.EVT_LEFT_UP(self, self._onLeftButtonUp)
wx.EVT_MOTION(self, self._onMotion)
wx.EVT_LEAVE_WINDOW(self, self._onLeave)
+ wx.EVT_IDLE(self, self._onIdle)
self.macros = {} # dict from wx id to seq of macros
@@ -1078,6 +1080,11 @@
return key
+ def _onIdle(self, evt):
+ 'a GUI idle event'
+ evt.Skip()
+ FigureCanvasBase.idle_event(self, guiEvent=evt)
+
def _onKeyDown(self, evt):
"""Capture key press."""
key = self._get_key(evt)
Modified: trunk/matplotlib/lib/matplotlib/cbook.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/cbook.py 2008-06-23 21:39:11 UTC (rev 5652)
+++ trunk/matplotlib/lib/matplotlib/cbook.py 2008-06-24 04:17:21 UTC (rev 5653)
@@ -3,7 +3,7 @@
from the Python Cookbook -- hence the name cbook
"""
from __future__ import generators
-import re, os, errno, sys, StringIO, traceback, locale
+import re, os, errno, sys, StringIO, traceback, locale, threading
import time, datetime
import numpy as np
@@ -152,7 +152,65 @@
func(*args, **kwargs)
+class Scheduler(threading.Thread):
+ """
+ Base class for timeout and idle scheduling
+ """
+ idlelock = threading.Lock()
+ id = 0
+ def __init__(self):
+ threading.Thread.__init__(self)
+ self.id = Scheduler.id
+ self._stopped = False
+ Scheduler.id += 1
+ self._stopevent = threading.Event()
+
+ def stop(self):
+ if self._stopped: return
+ self._stopevent.set()
+ self.join()
+ self._stopped = True
+
+class Timeout(Scheduler):
+ """
+ Schedule recurring events with a wait time in seconds
+ """
+ def __init__(self, wait, func):
+ Scheduler.__init__(self)
+ self.wait = wait
+ self.func = func
+
+ def run(self):
+
+ while not self._stopevent.isSet():
+ self._stopevent.wait(self.wait)
+ Scheduler.idlelock.acquire()
+ b = self.func(self)
+ Scheduler.idlelock.release()
+ if not b: break
+
+class Idle(Scheduler):
+ """
+ Schedule callbacks when scheduler is idle
+ """
+ # the prototype impl is a bit of a poor man's idle handler. It
+ # just implements a short wait time. But it will provide a
+ # placeholder for a proper impl ater
+ waittime = 0.05
+ def __init__(self, func):
+ Scheduler.__init__(self)
+ self.func = func
+
+ def run(self):
+
+ while not self._stopevent.isSet():
+ self._stopevent.wait(Idle.waittime)
+ Scheduler.idlelock.acquire()
+ b = self.func(self)
+ Scheduler.idlelock.release()
+ if not b: break
+
class silent_list(list):
"""
override repr when returning a list of matplotlib artists to
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-06-23 21:39:23
|
Revision: 5652
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5652&view=rev
Author: jdh2358
Date: 2008-06-23 14:39:11 -0700 (Mon, 23 Jun 2008)
Log Message:
-----------
draft idle/timeout api
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/afm.py
trunk/matplotlib/lib/matplotlib/backend_bases.py
trunk/matplotlib/lib/matplotlib/backends/backend_gtk.py
Added Paths:
-----------
trunk/matplotlib/examples/event_handling/idle_and_timeout.py
Added: trunk/matplotlib/examples/event_handling/idle_and_timeout.py
===================================================================
--- trunk/matplotlib/examples/event_handling/idle_and_timeout.py (rev 0)
+++ trunk/matplotlib/examples/event_handling/idle_and_timeout.py 2008-06-23 21:39:11 UTC (rev 5652)
@@ -0,0 +1,32 @@
+"""
+Demonstrate/test the idle and timeout API
+"""
+import matplotlib.pyplot as plt
+
+fig = plt.figure()
+ax = fig.add_subplot(111)
+
+ax.plot(range(10))
+
+def on_idle(canvas):
+ on_idle.count +=1
+ print 'idle', on_idle.count
+ if on_idle.count==10:
+ canvas.mpl_source_remove(on_idle)
+ return True
+on_idle.count = 0
+
+def on_timeout(canvas):
+ on_timeout.count +=1
+ print 'timeout', on_timeout.count
+ if on_timeout.count==10:
+ canvas.mpl_source_remove(on_timeout)
+ return True
+on_timeout.count = 0
+
+fig.canvas.mpl_idle_add(on_idle)
+fig.canvas.mpl_timeout_add(100, on_timeout)
+
+plt.show()
+
+
Modified: trunk/matplotlib/lib/matplotlib/afm.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/afm.py 2008-06-23 18:15:01 UTC (rev 5651)
+++ trunk/matplotlib/lib/matplotlib/afm.py 2008-06-23 21:39:11 UTC (rev 5652)
@@ -11,7 +11,7 @@
3) Did more than I needed and it was easier to write my own than
figure out how to just get what I needed from theirs
-It is pretty easy to use, and requires only built-in python libs:
+It is pretty easy to use, and requires only built-in python libs::
>>> from afm import AFM
>>> fh = file('ptmr8a.afm')
Modified: trunk/matplotlib/lib/matplotlib/backend_bases.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backend_bases.py 2008-06-23 18:15:01 UTC (rev 5651)
+++ trunk/matplotlib/lib/matplotlib/backend_bases.py 2008-06-23 21:39:11 UTC (rev 5652)
@@ -1316,6 +1316,33 @@
newCanvas = FigureCanvasClass(self.figure)
return newCanvas
+ def mpl_idle_add(self, func, *args, **kwargs):
+ """
+ add func to idle handler. The signature of func is::
+
+ func(canvas, *args, **kwargs)
+
+ use :meth:`mpl_source_remove` to remove func from the idle handler.
+ """
+ raise NotImplementedError('GUI backend must override')
+
+ def mpl_timeout_add(self, millisec, func, *args, **kwargs):
+ """
+ add func to timeout handler; func will be called every
+ millisec. The signature of func is::
+
+ func(canvas, *args, **kwargs)
+
+ use :meth:`mpl_source_remove` to remove func from the timeout handler.
+ """
+ raise NotImplementedError('GUI backend must override')
+
+ def mpl_source_remove(self, func):
+ """
+ remove func from idle or timeout handler
+ """
+ raise NotImplementedError('GUI backend must override')
+
def mpl_connect(self, s, func):
"""
Connect event with string *s* to *func*. The signature of *func* is::
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_gtk.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_gtk.py 2008-06-23 18:15:01 UTC (rev 5651)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_gtk.py 2008-06-23 21:39:11 UTC (rev 5652)
@@ -172,6 +172,8 @@
self.set_flags(gtk.CAN_FOCUS)
self._renderer_init()
+ # maps idle/timeout func -> id, remove_func for later removal
+ self.sourced = dict()
def scroll_event(self, widget, event):
if _debug: print 'FigureCanvasGTK.%s' % fn_name()
@@ -394,6 +396,53 @@
gtk.gdk.flush()
gtk.gdk.threads_leave()
+
+ def mpl_idle_add(self, func, *args, **kwargs):
+ """
+ add func to idle handler. The signature of func is::
+
+ func(canvas, *args, **kwargs)
+
+ use :meth:`mpl_source_remove` to remove func from the idle handler.
+ """
+ idle_add = getattr(gobject, 'idle_add', getattr(gtk, 'idle_add'))
+ remove = getattr(gobject, 'source_remove', getattr(gtk, 'idle_remove'))
+
+ def wrap():
+ b = func(self, *args, **kwargs)
+ return True
+
+ id = idle_add(wrap)
+ self.sourced[func] = id, remove
+
+
+ def mpl_timeout_add(self, millisec, func, *args, **kwargs):
+ """
+ add func to timeout handler; func will be called every
+ millisec. The signature of func is::
+
+ func(canvas, *args, **kwargs)
+
+ use :meth:`mpl_source_remove` to remove func from the timeout handler.
+ """
+ timeout_add = getattr(gobject, 'timeout_add', getattr(gtk, 'timeout_add'))
+ remove = getattr(gobject, 'source_remove', getattr(gtk, 'timeout_remove'))
+ def wrap():
+ b = func(self, *args, **kwargs)
+ return True
+
+ id = timeout_add(millisec, wrap)
+ self.sourced[func] = id, remove
+
+
+ def mpl_source_remove(self, func):
+ """
+ remove func from idle or timeout handler
+ """
+ id, remove = self.sourced[func]
+ remove(id)
+ del self.sourced[func]
+
class FigureManagerGTK(FigureManagerBase):
"""
Public attributes
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ds...@us...> - 2008-06-23 18:15:44
|
Revision: 5651
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5651&view=rev
Author: dsdale
Date: 2008-06-23 11:15:01 -0700 (Mon, 23 Jun 2008)
Log Message:
-----------
updated axis docstrings
converted colors docstrings, added to api reference
Modified Paths:
--------------
trunk/matplotlib/doc/api/index.rst
trunk/matplotlib/doc/devel/outline.rst
trunk/matplotlib/lib/matplotlib/axis.py
trunk/matplotlib/lib/matplotlib/colors.py
Added Paths:
-----------
trunk/matplotlib/doc/api/colors_api.rst
Added: trunk/matplotlib/doc/api/colors_api.rst
===================================================================
--- trunk/matplotlib/doc/api/colors_api.rst (rev 0)
+++ trunk/matplotlib/doc/api/colors_api.rst 2008-06-23 18:15:01 UTC (rev 5651)
@@ -0,0 +1,12 @@
+*****************
+matplotlib colors
+*****************
+
+
+:mod:`matplotlib.colors`
+========================
+
+.. automodule:: matplotlib.colors
+ :members:
+ :undoc-members:
+ :show-inheritance:
Modified: trunk/matplotlib/doc/api/index.rst
===================================================================
--- trunk/matplotlib/doc/api/index.rst 2008-06-23 17:46:26 UTC (rev 5650)
+++ trunk/matplotlib/doc/api/index.rst 2008-06-23 18:15:01 UTC (rev 5651)
@@ -21,5 +21,6 @@
cm_api.rst
collections_api.rst
colorbar_api.rst
+ colors_api.rst
pyplot_api.rst
index_backend_api.rst
Modified: trunk/matplotlib/doc/devel/outline.rst
===================================================================
--- trunk/matplotlib/doc/devel/outline.rst 2008-06-23 17:46:26 UTC (rev 5650)
+++ trunk/matplotlib/doc/devel/outline.rst 2008-06-23 18:15:01 UTC (rev 5651)
@@ -114,13 +114,13 @@
afm converted
artist converted
axes converted
-axis needs conversion
-backend_bases needs conversion
-cbook needs conversion
-cm needs conversion
-collections needs conversion
-colorbar needs conversion
-colors Darren needs conversion
+axis converted
+backend_bases converted
+cbook converted
+cm converted
+collections converted
+colorbar converted
+colors converted
contour needs conversion
dates Darren needs conversion
dviread Darren needs conversion
@@ -137,7 +137,7 @@
patches needs conversion
path needs conversion
pylab needs conversion
-pyplot needs conversion
+pyplot converted
quiver needs conversion
rcsetup needs conversion
scale needs conversion
Modified: trunk/matplotlib/lib/matplotlib/axis.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axis.py 2008-06-23 17:46:26 UTC (rev 5650)
+++ trunk/matplotlib/lib/matplotlib/axis.py 2008-06-23 18:15:01 UTC (rev 5651)
@@ -315,7 +315,7 @@
return l
def update_position(self, loc):
- 'Set the location of tick in data coords with scalar loc'
+ 'Set the location of tick in data coords with scalar *loc*'
x = loc
nonlinear = (hasattr(self.axes, 'yaxis') and
@@ -504,8 +504,8 @@
"""
Public attributes
- * transData - transform data coords to display coords
- * transAxis - transform axis coords to display coords
+ * :attr:`transData` - transform data coords to display coords
+ * :attr:`transAxis` - transform axis coords to display coords
"""
LABELPAD = 5
@@ -909,14 +909,14 @@
def grid(self, b=None, which='major', **kwargs):
"""
- Set the axis grid on or off; b is a boolean use which =
+ Set the axis grid on or off; b is a boolean use *which* =
'major' | 'minor' to set the grid for major or minor ticks
- if b is None and len(kwargs)==0, toggle the grid state. If
- kwargs are supplied, it is assumed you want the grid on and b
+ if *b* is *None* and len(kwargs)==0, toggle the grid state. If
+ *kwargs* are supplied, it is assumed you want the grid on and *b*
will be set to True
- kwargs are used to set the line properties of the grids, eg,
+ *kwargs* are used to set the line properties of the grids, eg,
xax.grid(color='r', linestyle='-', linewidth=2)
"""
@@ -939,8 +939,8 @@
def update_units(self, data):
"""
- introspect data for units converter and update the
- axis.converter instance if necessary. Return true is data is
+ introspect *data* for units converter and update the
+ axis.converter instance if necessary. Return *True* is *data* is
registered for unit conversion
"""
@@ -1022,7 +1022,7 @@
"""
Set the formatter of the major ticker
- ACCEPTS: A Formatter instance
+ ACCEPTS: A :class:`~matplotlib.ticker.Formatter` instance
"""
self.major.formatter = formatter
formatter.set_axis(self)
@@ -1032,7 +1032,7 @@
"""
Set the formatter of the minor ticker
- ACCEPTS: A Formatter instance
+ ACCEPTS: A :class:`~matplotlib.ticker.Formatter` instance
"""
self.minor.formatter = formatter
formatter.set_axis(self)
@@ -1042,7 +1042,7 @@
"""
Set the locator of the major ticker
- ACCEPTS: a Locator instance
+ ACCEPTS: a :class:`~matplotlib.ticker.Locator` instance
"""
self.major.locator = locator
locator.set_axis(self)
@@ -1052,7 +1052,7 @@
"""
Set the locator of the minor ticker
- ACCEPTS: a Locator instance
+ ACCEPTS: a :class:`~matplotlib.ticker.Locator` instance
"""
self.minor.locator = locator
locator.set_axis(self)
@@ -1069,7 +1069,7 @@
def set_ticklabels(self, ticklabels, *args, **kwargs):
"""
Set the text values of the tick labels. Return a list of Text
- instances. Use kwarg minor=True to select minor ticks.
+ instances. Use *kwarg* *minor=True* to select minor ticks.
ACCEPTS: sequence of strings
"""
@@ -1128,11 +1128,11 @@
raise NotImplementedError('Derived must override')
def pan(self, numsteps):
- 'Pan numticks (can be positive or negative)'
+ 'Pan *numsteps* (can be positive or negative)'
self.major.locator.pan(numsteps)
def zoom(self, direction):
- "Zoom in/out on axis; if direction is >0 zoom in, else zoom out"
+ "Zoom in/out on axis; if *direction* is >0 zoom in, else zoom out"
self.major.locator.zoom(direction)
class XAxis(Axis):
@@ -1372,7 +1372,7 @@
def contains(self,mouseevent):
"""Test whether the mouse event occurred in the y axis.
- Returns T/F, {}
+ Returns *True* | *False*
"""
if callable(self._contains): return self._contains(self,mouseevent)
Modified: trunk/matplotlib/lib/matplotlib/colors.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/colors.py 2008-06-23 17:46:26 UTC (rev 5650)
+++ trunk/matplotlib/lib/matplotlib/colors.py 2008-06-23 18:15:01 UTC (rev 5651)
@@ -18,17 +18,17 @@
w : white
Gray shades can be given as a string encoding a float in the 0-1
-range, e.g.,
+range, e.g.::
color = '0.75'
For a greater range of colors, you have two options. You can specify
-the color using an html hex string, as in
+the color using an html hex string, as in::
color = '#eeefff'
-or you can pass an R,G,B tuple, where each of R,G,B are in the range
-[0,1].
+or you can pass an *R* , *G* , *B* tuple, where each of *R* , *G* , *B*
+are in the range [0,1].
Finally, legal html names for colors, like 'red', 'burlywood' and
'chartreuse' are supported.
@@ -203,7 +203,7 @@
def hex2color(s):
"""
- Take a hex string 's' and return the corresponding rgb 3-tuple
+ Take a hex string *s* and return the corresponding rgb 3-tuple
Example: #efefef -> (0.93725, 0.93725, 0.93725)
"""
if not isinstance(s, basestring):
@@ -227,15 +227,17 @@
cache = {}
def to_rgb(self, arg):
"""
- Returns an RGB tuple of three floats from 0-1.
+ Returns an *RGB* tuple of three floats from 0-1.
- arg can be an RGB or RGBA sequence or a string in any of several forms:
+ *arg* can be an *RGB* or *RGBA* sequence or a string in any of
+ several forms:
+
1) a letter from the set 'rgbcmykw'
2) a hex color string, like '#00FFFF'
3) a standard name, like 'aqua'
4) a float, like '0.4', indicating gray on a 0-1 scale
- if arg is RGBA, the A will simply be discarded.
+ if *arg* is *RGBA*, the *A* will simply be discarded.
"""
try: return self.cache[arg]
except KeyError: pass
@@ -283,11 +285,11 @@
def to_rgba(self, arg, alpha=None):
"""
- Returns an RGBA tuple of four floats from 0-1.
+ Returns an *RGBA* tuple of four floats from 0-1.
- For acceptable values of arg, see to_rgb.
- If arg is an RGBA sequence and alpha is not None,
- alpha will replace the original A.
+ For acceptable values of *arg*, see :meth:`to_rgb`.
+ If *arg* is an *RGBA* sequence and *alpha* is not *None*,
+ *alpha* will replace the original *A*.
"""
try:
if not cbook.is_string_like(arg) and cbook.iterable(arg):
@@ -313,13 +315,13 @@
def to_rgba_array(self, c, alpha=None):
"""
- Returns an Numpy array of rgba tuples.
+ Returns an Numpy array of *RGBA* tuples.
Accepts a single mpl color spec or a sequence of specs.
If the sequence is a list or array, the items are changed in place,
but an array copy is still returned.
- Special case to handle "no color": if c is "none" (case-insensitive),
+ Special case to handle "no color": if *c* is "none" (case-insensitive),
then an empty array will be returned. Same for an empty list.
"""
try:
@@ -345,9 +347,9 @@
colorConverter = ColorConverter()
def makeMappingArray(N, data):
- """Create an N-element 1-d lookup table
+ """Create an *N* -element 1-d lookup table
- data represented by a list of x,y0,y1 mapping correspondences.
+ *data* represented by a list of x,y0,y1 mapping correspondences.
Each element in this list represents how a value between 0 and 1
(inclusive) represented by x is mapped to a corresponding value
between 0 and 1 (inclusive). The two values of y are to allow
@@ -358,7 +360,7 @@
all values of x must be in increasing order. Values between
the given mapping points are determined by simple linear interpolation.
- The function returns an array "result" where result[x*(N-1)]
+ The function returns an array "result" where ``result[x*(N-1)]``
gives the closest value for values of x between 0 and 1.
"""
try:
@@ -400,14 +402,16 @@
"""Base class for all scalar to rgb mappings
Important methods:
- set_bad()
- set_under()
- set_over()
+
+ * :meth:`set_bad`
+ * :meth:`set_under`
+ * :meth:`set_over`
"""
def __init__(self, name, N=256):
- """Public class attributes:
- self.N: number of rgb quantization levels
- self.name: name of colormap
+ """
+ Public class attributes:
+ :attr:`N` : number of rgb quantization levels
+ :attr:`name` : name of colormap
"""
self.name = name
@@ -423,7 +427,7 @@
def __call__(self, X, alpha=1.0, bytes=False):
"""
- X is either a scalar or an array (of any dimension).
+ *X* is either a scalar or an array (of any dimension).
If scalar, a tuple of rgba values is returned, otherwise
an array with the new shape = oldshape+(4,). If the X-values
are integers, then they are used as indices into the array.
@@ -551,13 +555,22 @@
"""
Make a colormap from a list of colors.
- colors is a list of matplotlib color specifications,
- or an equivalent Nx3 floating point array (N rgb values)
- name is a string to identify the colormap
- N is the number of entries in the map. The default is None,
+ *colors*
+ a list of matplotlib color specifications,
+ or an equivalent Nx3 floating point array (*N* rgb values)
+ *name*
+ a string to identify the colormap
+ *N*
+ the number of entries in the map. The default is *None*,
in which case there is one colormap entry for each
- element in the list of colors. If N < len(colors)
- the list will be truncated at N. If N > len(colors),
+ element in the list of colors. If::
+
+ N < len(colors)
+
+ the list will be truncated at *N*. If::
+
+ N > len(colors)
+
the list will be extended by repetition.
"""
self.colors = colors
@@ -600,16 +613,19 @@
"""
def __init__(self, vmin=None, vmax=None, clip=False):
"""
- If vmin or vmax is not given, they are taken from the input's
- minimum and maximum value respectively. If clip is True and
+ If *vmin* or *vmax* is not given, they are taken from the input's
+ minimum and maximum value respectively. If *clip* is *True* and
the given value falls outside the range, the returned value
- will be 0 or 1, whichever is closer. Returns 0 if vmin==vmax.
+ will be 0 or 1, whichever is closer. Returns 0 if::
+
+ vmin==vmax
+
Works with scalars or arrays, including masked arrays. If
- clip is True, masked values are set to 1; otherwise they
+ *clip* is *True*, masked values are set to 1; otherwise they
remain masked. Clipping silently defeats the purpose of setting
the over, under, and masked colors in the colormap, so it is
likely to lead to surprises; therefore the default is
- clip=False.
+ *clip* = *False*.
"""
self.vmin = vmin
self.vmax = vmax
@@ -656,7 +672,7 @@
def autoscale(self, A):
'''
- Set vmin, vmax to min, max of A.
+ Set *vmin*, *vmax* to min, max of *A*.
'''
self.vmin = ma.minimum(A)
self.vmax = ma.maximum(A)
@@ -718,8 +734,9 @@
'''
Generate a colormap index based on discrete intervals.
- Unlike Normalize or LogNorm, BoundaryNorm maps values
- to integers instead of to the interval 0-1.
+ Unlike :class:`Normalize` or :class:`LogNorm`,
+ :class:`BoundaryNorm` maps values to integers instead of to the
+ interval 0-1.
Mapping to the 0-1 interval could have been done via
piece-wise linear interpolation, but using integers seems
@@ -728,17 +745,22 @@
'''
def __init__(self, boundaries, ncolors, clip=False):
'''
- args:
- boundaries: a monotonically increasing sequence
- ncolors: number of colors in the colormap to be used
+ *boundaries*
+ a monotonically increasing sequence
+ *ncolors*
+ number of colors in the colormap to be used
- If b[i] <= v < b[i+1] then v is mapped to color j;
+ If::
+
+ b[i] <= v < b[i+1]
+
+ then v is mapped to color j;
as i varies from 0 to len(boundaries)-2,
j goes from 0 to ncolors-1.
Out-of-range values are mapped to -1 if low and ncolors
if high; these are converted to valid indices by
- Colormap.__call__.
+ :meth:`Colormap.__call__` .
'''
self.clip = clip
self.vmin = boundaries[0]
@@ -778,7 +800,8 @@
class NoNorm(Normalize):
'''
Dummy replacement for Normalize, for the case where we
- want to use indices directly in a ScalarMappable.
+ want to use indices directly in a
+ :class:`~matplotlib.cm.ScalarMappable` .
'''
def __call__(self, value, clip=None):
return value
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ds...@us...> - 2008-06-23 17:46:52
|
Revision: 5650
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5650&view=rev
Author: dsdale
Date: 2008-06-23 10:46:26 -0700 (Mon, 23 Jun 2008)
Log Message:
-----------
finish converting axes docstrings
Modified Paths:
--------------
trunk/matplotlib/doc/devel/outline.rst
trunk/matplotlib/lib/matplotlib/axes.py
Modified: trunk/matplotlib/doc/devel/outline.rst
===================================================================
--- trunk/matplotlib/doc/devel/outline.rst 2008-06-23 16:16:24 UTC (rev 5649)
+++ trunk/matplotlib/doc/devel/outline.rst 2008-06-23 17:46:26 UTC (rev 5650)
@@ -113,7 +113,7 @@
projections/polar needs conversion
afm converted
artist converted
-axes needs conversion
+axes converted
axis needs conversion
backend_bases needs conversion
cbook needs conversion
Modified: trunk/matplotlib/lib/matplotlib/axes.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axes.py 2008-06-23 16:16:24 UTC (rev 5649)
+++ trunk/matplotlib/lib/matplotlib/axes.py 2008-06-23 17:46:26 UTC (rev 5650)
@@ -69,15 +69,16 @@
def _process_plot_format(fmt):
"""
Process a matlab(TM) style color/line style format string. Return a
- linestyle, color tuple as a result of the processing. Default
+ (*linestyle*, *color*) tuple as a result of the processing. Default
values are ('-', 'b'). Example format strings include:
* 'ko': black circles
* '.b': blue dots
* 'r--': red dashed lines
- See Line2D.lineStyles and GraphicsContext.colors for all possible
- styles and color format string.
+ See :func:`~matplotlib.Line2D.lineStyles` and
+ :func:`~matplotlib.pyplot.colors` for all possible styles and
+ color format string.
"""
@@ -138,10 +139,11 @@
def set_default_color_cycle(clist):
"""
Change the default cycle of colors that will be used by the plot
- command. This must be called before creating the Axes to which
- it will apply; it will apply to all future Axes.
+ command. This must be called before creating the
+ :class:`Axes` to which it will apply; it will
+ apply to all future axes.
- clist is a sequence of mpl color specifiers
+ *clist* is a sequence of mpl color specifiers
"""
_process_plot_var_args.defaultColors = clist[:]
@@ -158,7 +160,7 @@
plot(t1, s1, 'ko', t2, s2)
plot(t1, s1, 'ko', t2, s2, 'r--', t3, e3)
- an arbitrary number of x, y, fmt are allowed
+ an arbitrary number of *x*, *y*, *fmt* are allowed
"""
defaultColors = ['b','g','r','c','m','y','k']
@@ -444,13 +446,17 @@
class Axes(martist.Artist):
"""
- The Axes contains most of the figure elements: Axis, Tick, Line2D,
- Text, Polygon etc, and sets the coordinate system
+ The :class:`Axes` contains most of the figure elements:
+ :class:`~matplotlib.axis.Axis`, :class:`~matplotlib.axis.Tick`,
+ :class:`~matplotlib.lines.Line2D`, :class:`~matplotlib.text.Text`,
+ :class:`~matplotlib.patches.Polygon`, etc., and sets the
+ coordinate system.
- The Axes instance supports callbacks through a callbacks attribute
- which is a cbook.CallbackRegistry instance. The events you can
- connect to are 'xlim_changed' and 'ylim_changed' and the callback
- will be called with func(ax) where ax is the Axes instance
+ The :class:`Axes` instance supports callbacks through a callbacks attribute
+ which is a :class:`~matplotlib.cbook.CallbackRegistry` instance.
+ The events you can connect to are :meth:`xlim_changed` and
+ :meth:`ylim_changed` and the callback will be called with
+ func(*ax() where *ax* is the :class:`Axes` instance.
"""
name = "rectilinear"
@@ -469,45 +475,55 @@
**kwargs
):
"""
- Build an Axes instance in Figure fig with
- rect=[left, bottom, width, height] in Figure coords
+ Build an :class:`Axes` instance in
+ :class:`~matplotlib.figure.Figure` *fig* with
+ *rect=[left, bottom, width, height]* in
+ :class:`~matplotlib.figure.Figure` coordinates
Optional keyword arguments:
- ============== ====================================================
- Keyword Description
- ============== ====================================================
- adjustable [ 'box' | 'datalim' ]
- alpha float: the alpha transparency
- anchor [ 'C', 'SW', 'S', 'SE', 'E', 'NE', 'N', 'NW', 'W' ]
- aspect [ 'auto' | 'equal' | aspect_ratio ]
- autoscale_on [ True | False ] whether or not to autoscale the
- viewlim
- axis_bgcolor any matplotlib color - see help(colors)
- axisbelow draw the grids and ticks below the other artists
- cursor_props a (float, color) tuple
- figure a Figure instance
- frame_on a boolean - draw the axes frame
- label the axes label
- navigate [ True | False ]
- navigate_mode [ 'PAN' | 'ZOOM' | None ] the navigation toolbar
- button status
- position [left, bottom, width, height] in Figure coords
- sharex an Axes instance to share the x-axis with
- sharey an Axes instance to share the y-axis with
- title the title string
- visible [ True | False ] whether the axes is visible
- xlabel the xlabel
- xlim (xmin, xmax) view limits
- xscale [%(scale)s]
- xticklabels sequence of strings
- xticks sequence of floats
- ylabel the ylabel strings
- ylim (ymin, ymax) view limits
- yscale [%(scale)s]
- yticklabels sequence of strings
- yticks sequence of floats
- ============== ====================================================
+ ================ =========================================
+ Keyword Description
+ ================ =========================================
+ *adjustable* [ 'box' | 'datalim' ]
+ *alpha* float: the alpha transparency
+ *anchor* [ 'C', 'SW', 'S', 'SE', 'E', 'NE', 'N',
+ 'NW', 'W' ]
+ *aspect* [ 'auto' | 'equal' | aspect_ratio ]
+ *autoscale_on* [ *True* | *False* ] whether or not to
+ autoscale the *viewlim*
+ *axis_bgcolor* any matplotlib color, see
+ :func:`~matplotlib.pyplot.colors`
+ *axisbelow* draw the grids and ticks below the other
+ artists
+ *cursor_props* a (*float*, *color*) tuple
+ *figure* a :class:`~matplotlib.figure.Figure`
+ instance
+ *frame_on* a boolean - draw the axes frame
+ *label* the axes label
+ *navigate* [ *True* | *False* ]
+ *navigate_mode* [ 'PAN' | 'ZOOM' | None ] the navigation
+ toolbar button status
+ *position* [left, bottom, width, height] in
+ class:`~matplotlib.figure.Figure` coords
+ *sharex* an class:`~matplotlib.axes.Axes` instance
+ to share the x-axis with
+ *sharey* an class:`~matplotlib.axes.Axes` instance
+ to share the y-axis with
+ *title* the title string
+ *visible* [ *True* | *False* ] whether the axes is
+ visible
+ *xlabel* the xlabel
+ *xlim* (*xmin*, *xmax*) view limits
+ *xscale* [%(scale)s]
+ *xticklabels* sequence of strings
+ *xticks* sequence of floats
+ *ylabel* the ylabel strings
+ *ylim* (*ymin*, *ymax*) view limits
+ *yscale* [%(scale)s]
+ *yticklabels* sequence of strings
+ *yticks* sequence of floats
+ ================ =========================================
""" % {'scale': ' | '.join([repr(x) for x in mscale.get_scale_names()])}
martist.Artist.__init__(self)
if isinstance(rect, mtransforms.Bbox):
@@ -562,7 +578,10 @@
self._ycid = self.yaxis.callbacks.connect('units finalize', self.relim)
def get_window_extent(self, *args, **kwargs):
- 'get the axes bounding box in display space; args and kwargs are empty'
+ '''
+ get the axes bounding box in display space; *args* and
+ *kwargs* are empty
+ '''
return self.bbox
def _init_axis(self):
@@ -573,9 +592,9 @@
def set_figure(self, fig):
"""
- Set the Axes' figure
+ Set the class:`~matplotlib.axes.Axes` figure
- accepts a Figure instance
+ accepts a class:`~matplotlib.figure.Figure` instance
"""
martist.Artist.set_figure(self, fig)
@@ -589,8 +608,9 @@
def _set_lim_and_transforms(self):
"""
- set the dataLim and viewLim BBox attributes and the
- transScale, transData, transLimits and transAxes
+ set the *dataLim* and *viewLim*
+ :class:`~matplotlib.transforms.Bbox` attributes and the
+ *transScale*, *transData*, *transLimits* and *transAxes*
transformations.
"""
self.transAxes = mtransforms.BboxTransformTo(self.bbox)
@@ -620,9 +640,11 @@
and gridlines. The x-direction is in data coordinates and the
y-direction is in axis coordinates.
- This transformation is primarily used by the Axis class, and
- is meant to be overridden by new kinds of projections that may
- need to place axis elements in different locations.
+ .. note::
+ This transformation is primarily used by the
+ :class:`~matplotlib.axis.Axis` class, and is meant to be
+ overridden by new kinds of projections that may need to
+ place axis elements in different locations.
"""
return self._xaxis_transform
@@ -631,16 +653,19 @@
Get the transformation used for drawing x-axis labels, which
will add the given amount of padding (in points) between the
axes and the label. The x-direction is in data coordinates
- and the y-direction is in axis coordinates. Returns a 3-tuple
- of the form::
+ and the y-direction is in axis coordinates. Returns a
+ 3-tuple of the form::
(transform, valign, halign)
- where valign and halign are requested alignments for the text.
+ where *valign* and *halign* are requested alignments for the
+ text.
- This transformation is primarily used by the Axis class, and
- is meant to be overridden by new kinds of projections that may
- need to place axis elements in different locations.
+ .. note::
+ This transformation is primarily used by the
+ :class:`~matplotlib.axis.Axis` class, and is meant to be
+ overridden by new kinds of projections that may need to
+ place axis elements in different locations.
"""
return (self._xaxis_transform +
mtransforms.ScaledTranslation(0, -1 * pad_points / 72.0,
@@ -657,11 +682,14 @@
(transform, valign, halign)
- where valign and halign are requested alignments for the text.
+ where *valign* and *halign* are requested alignments for the
+ text.
- This transformation is primarily used by the Axis class, and
- is meant to be overridden by new kinds of projections that may
- need to place axis elements in different locations.
+ .. note::
+ This transformation is primarily used by the
+ :class:`~matplotlib.axis.Axis` class, and is meant to be
+ overridden by new kinds of projections that may need to
+ place axis elements in different locations.
"""
return (self._xaxis_transform +
mtransforms.ScaledTranslation(0, pad_points / 72.0,
@@ -674,9 +702,11 @@
and gridlines. The x-direction is in axis coordinates and the
y-direction is in data coordinates.
- This transformation is primarily used by the Axis class, and
- is meant to be overridden by new kinds of projections that may
- need to place axis elements in different locations.
+ .. note::
+ This transformation is primarily used by the
+ :class:`~matplotlib.axis.Axis` class, and is meant to be
+ overridden by new kinds of projections that may need to
+ place axis elements in different locations.
"""
return self._yaxis_transform
@@ -690,11 +720,14 @@
(transform, valign, halign)
- where valign and halign are requested alignments for the text.
+ where *valign* and *halign* are requested alignments for the
+ text.
- This transformation is primarily used by the Axis class, and
- is meant to be overridden by new kinds of projections that may
- need to place axis elements in different locations.
+ .. note::
+ This transformation is primarily used by the
+ :class:`~matplotlib.axis.Axis` class, and is meant to be
+ overridden by new kinds of projections that may need to
+ place axis elements in different locations.
"""
return (self._yaxis_transform +
mtransforms.ScaledTranslation(-1 * pad_points / 72.0, 0,
@@ -711,11 +744,15 @@
(transform, valign, halign)
- where valign and halign are requested alignments for the text.
+ where *valign* and *halign* are requested alignments for the
+ text.
- This transformation is primarily used by the Axis class, and
- is meant to be overridden by new kinds of projections that may
- need to place axis elements in different locations.
+ .. note::
+
+ This transformation is primarily used by the
+ :class:`~matplotlib.axis.Axis` class, and is meant to be
+ overridden by new kinds of projections that may need to
+ place axis elements in different locations.
"""
return (self._yaxis_transform +
mtransforms.ScaledTranslation(pad_points / 72.0, 0,
@@ -740,19 +777,20 @@
def set_position(self, pos, which='both'):
"""
- Set the axes position with pos = [left, bottom, width, height]
- in relative 0,1 coords
+ Set the axes position with::
+ pos = [left, bottom, width, height]
+
+ in relative 0,1 coords, or *pos* can be a
+ :class:`~matplotlib.transforms.Bbox`
+
There are two position variables: one which is ultimately
- used, but which may be modified by apply_aspect, and a second
- which is the starting point for apply_aspect.
+ used, but which may be modified by :meth:`apply_aspect`, and a
+ second which is the starting point for :meth:`apply_aspect`.
- Required arguments:
- pos:
- len(4) sequence of floats, or a Bbox object
Optional keyword arguments:
- which:
+ *which*
========== ====================
value description
@@ -786,7 +824,8 @@
In the standard axes, this is a rectangle, but in other
projections it may not be.
- Intended to be overridden by new projection types.
+ .. note::
+ Intended to be overridden by new projection types.
"""
return mpatches.Rectangle((0.0, 0.0), 1.0, 1.0)
@@ -882,8 +921,8 @@
hold(b=None)
- Set the hold state. If hold is None (default), toggle the
- hold state. Else set the hold state to boolean value b.
+ Set the hold state. If *hold* is *None* (default), toggle the
+ *hold* state. Else set the *hold* state to boolean value *b*.
Examples:
@@ -910,7 +949,7 @@
def set_aspect(self, aspect, adjustable=None, anchor=None):
"""
- aspect:
+ *aspect*
======== ================================================
value description
@@ -923,7 +962,7 @@
aspect='equal'.
======== ================================================
- adjustable:
+ *adjustable*
========= ============================
value description
@@ -932,7 +971,7 @@
'datalim' change xlim or ylim
========= ============================
- anchor:
+ *anchor*
===== =====================
value description
@@ -974,7 +1013,7 @@
def set_anchor(self, anchor):
"""
- anchor:
+ *anchor*
===== ============
value description
@@ -1012,7 +1051,7 @@
def apply_aspect(self, position=None):
'''
- Use self._aspect and self._adjustable to modify the
+ Use :meth:`_aspect` and :meth:`_adjustable` to modify the
axes box or the view limits.
'''
if position is None:
@@ -1109,8 +1148,8 @@
Convenience method for manipulating the x and y view limits
and the aspect ratio of the plot.
- kwargs are passed on to set_xlim and set_ylim -- see their
- docstrings for details
+ *kwargs* are passed on to :meth:`set_xlim` and
+ :meth:`set_ylim`
'''
if len(v)==1 and is_string_like(v[0]):
s = v[0].lower()
@@ -1164,7 +1203,9 @@
def get_child_artists(self):
"""
- Return a list of artists the axes contains. Deprecated
+ Return a list of artists the axes contains.
+
+ .. deprecated:: 0.98
"""
raise DeprecationWarning('Use get_children instead')
@@ -1213,9 +1254,9 @@
#### Adding and tracking artists
def has_data(self):
- '''Return true if any artists have been added to axes.
+ '''Return *True* if any artists have been added to axes.
- This should not be used to determine whether the dataLim
+ This should not be used to determine whether the *dataLim*
need to be updated, and may not actually be useful for
anything.
'''
@@ -1226,7 +1267,7 @@
len(self.patches))>0
def add_artist(self, a):
- 'Add any artist to the axes'
+ 'Add any :class:`~matplotlib.artist.Artist` to the axes'
a.set_axes(self)
self.artists.append(a)
self._set_artist_props(a)
@@ -1234,7 +1275,10 @@
a._remove_method = lambda h: self.artists.remove(h)
def add_collection(self, collection, autolim=True):
- 'add a Collection instance to Axes'
+ '''
+ add a :class:`~matplotlib.collections.Collection` instance
+ to the axes
+ '''
label = collection.get_label()
if not label:
collection.set_label('collection%d'%len(self.collections))
@@ -1247,7 +1291,10 @@
collection._remove_method = lambda h: self.collections.remove(h)
def add_line(self, line):
- 'Add a line to the list of plot lines'
+ '''
+ Add a :class:`~matplotlib.lines.Line2D` to the list of plot
+ lines
+ '''
self._set_artist_props(line)
line.set_clip_path(self.axesPatch)
@@ -1263,9 +1310,10 @@
def add_patch(self, p):
"""
- Add a patch to the list of Axes patches; the clipbox will be
- set to the Axes clipping box. If the transform is not set, it
- wil be set to self.transData.
+ Add a :class:`~matplotlib.patches.Patch` *p* to the list of
+ axes patches; the clipbox will be set to the Axes clipping
+ box. If the transform is not set, it will be set to
+ :attr:`transData`.
"""
self._set_artist_props(p)
@@ -1275,7 +1323,7 @@
p._remove_method = lambda h: self.patches.remove(h)
def _update_patch_limits(self, p):
- 'update the datalimits for patch p'
+ 'update the data limits for patch *p*'
# hist can add zero height Rectangles, which is useful to keep
# the bins, counts and patches lined up, but it throws off log
# scaling. We'll ignore rects with zero height or width in
@@ -1291,14 +1339,17 @@
self.update_datalim(vertices)
def add_table(self, tab):
- 'Add a table instance to the list of axes tables'
+ '''
+ Add a :class:`~matplotlib.tables.Table` instance to the
+ list of axes tables
+ '''
self._set_artist_props(tab)
self.tables.append(tab)
tab.set_clip_path(self.axesPatch)
tab._remove_method = lambda h: self.tables.remove(h)
def relim(self):
- 'recompute the datalimits based on current artists'
+ 'recompute the data limits based on current artists'
self.dataLim.ignore(True)
self.ignore_existing_data_limits = True
for line in self.lines:
@@ -1331,11 +1382,14 @@
self.ignore_existing_data_limits = False
def update_datalim_bounds(self, bounds):
- 'Update the datalim to include the given Bbox'
+ '''
+ Update the datalim to include the given
+ :class:`~matplotlib.transforms.Bbox` *bounds*
+ '''
self.dataLim.set(Bbox.union([self.dataLim, bounds]))
def _process_unit_info(self, xdata=None, ydata=None, kwargs=None):
- 'look for unit kwargs and update the axis instances as necessary'
+ 'look for unit *kwargs* and update the axis instances as necessary'
if self.xaxis is None or self.yaxis is None: return
@@ -1361,7 +1415,10 @@
self.yaxis.set_units(yunits)
def in_axes(self, mouseevent):
- 'return True if the given mouseevent (in display coords) is in the Axes'
+ '''
+ return *True* if the given *mouseevent* (in display coords)
+ is in the Axes
+ '''
return self.axesPatch.contains(mouseevent)[0]
def get_autoscale_on(self):
@@ -1374,7 +1431,7 @@
"""
Set whether autoscaling is applied on plot commands
- accepts: True|False
+ accepts: [ *True* | *False* ]
"""
self._autoscaleon = b
@@ -1382,7 +1439,7 @@
"""
autoscale the view limits using the data limits. You can
selectively autoscale only a single axis, eg, the xaxis by
- setting scaley to False. The autoscaling preserves any
+ setting *scaley* to *False*. The autoscaling preserves any
axis direction reversal that has already been done.
"""
# if image data only just use the datalim
@@ -1528,13 +1585,13 @@
"""
Set whether the axes rectangle patch is drawn
- ACCEPTS: [ True | False ]
+ ACCEPTS: [ *True* | *False* ]
"""
self._frameon = b
def get_axisbelow(self):
"""
- Get whether axist below is true or not
+ Get whether axis below is true or not
"""
return self._axisbelow
@@ -1542,7 +1599,7 @@
"""
Set whether the axis ticks and gridlines are above or below most artists
- ACCEPTS: [ True | False ]
+ ACCEPTS: [ *True* | *False* ]
"""
self._axisbelow = b
@@ -1554,11 +1611,11 @@
Set the axes grids on or off; *b* is a boolean
- If *b* is *None* and len(kwargs)==0, toggle the grid state. If
- kwargs are supplied, it is assumed that you want a grid and *b*
+ If *b* is *None* and ``len(kwargs)==0``, toggle the grid state. If
+ *kwargs* are supplied, it is assumed that you want a grid and *b*
is thus set to *True*
- kawrgs are used to set the grid line properties, eg::
+ *kawrgs* are used to set the grid line properties, eg::
ax.grid(color='r', linestyle='-', linewidth=2)
@@ -1581,17 +1638,20 @@
======= =====================================
Keyword Description
======= =====================================
- style [ 'sci' (or 'scientific') | 'plain' ]
+ *style* [ 'sci' (or 'scientific') | 'plain' ]
plain turns off scientific notation
- axis [ 'x' | 'y' | 'both' ]
+ *axis* [ 'x' | 'y' | 'both' ]
======= =====================================
Only the major ticks are affected.
- If the method is called when the ScalarFormatter is not
- the one being used, an AttributeError will be raised with
- no additional error message.
+ If the method is called when the
+ :class:`~matplotlib.ticker.ScalarFormatter` is not the
+ :class:`~matplotlib.ticker.Formatter` being used, an
+ :exc:`AttributeError` will be raised with no additional error
+ message.
- Additional capabilities and/or friendlier error checking may be added.
+ Additional capabilities and/or friendlier error checking may
+ be added.
"""
style = kwargs.pop('style', '').lower()
@@ -1631,7 +1691,8 @@
"""
set the axes background color
- ACCEPTS: any matplotlib color - see help(colors)
+ ACCEPTS: any matplotlib color - see
+ :func:`~matplotlib.pyplot.colors`
"""
self._axisbg = color
@@ -1688,7 +1749,7 @@
def get_xlim(self):
"""
- Get the x-axis range [xmin, xmax]
+ Get the x-axis range [*xmin*, *xmax*]
"""
return self.viewLim.intervalx
@@ -1700,7 +1761,7 @@
Set the limits for the xaxis
- Returns the current xlimits as a length 2 tuple: [xmin, xmax]
+ Returns the current xlimits as a length 2 tuple: [*xmin*, *xmax*]
Examples::
@@ -1709,15 +1770,14 @@
set_xlim(xmin=1) # xmax unchanged
set_xlim(xmax=1) # xmin unchanged
- Valid keyword arguments:
+ Keyword arguments:
- ======= ==============================
- Keyword Description
- ======= ==============================
- xmin the min of the xlim
- xmax the max of the xlim
- emit notify observers of lim change
- ======= ==============================
+ *ymin*: scalar
+ the min of the ylim
+ *ymax*: scalar
+ the max of the ylim
+ *emit*: [ True | False ]
+ notify observers of lim change
ACCEPTS: len(2) sequence of floats
"""
@@ -1783,7 +1843,7 @@
def set_xticks(self, ticks, minor=False):
"""
- Set the x ticks with list of ticks
+ Set the x ticks with list of *ticks*
ACCEPTS: sequence of floats
"""
@@ -1807,10 +1867,11 @@
set_xticklabels(labels, fontdict=None, minor=False, **kwargs)
- Set the xtick labels with list of strings labels Return a list of axis
- text instances.
+ Set the xtick labels with list of strings *labels*. Return a
+ list of axis text instances.
- kwargs set the Text properties. Valid properties are
+ *kwargs* set the :class:`~matplotlib.text.Text` properties.
+ Valid properties are
%(Text)s
ACCEPTS: sequence of strings
@@ -1861,7 +1922,7 @@
def get_ylim(self):
"""
- Get the y-axis range [xmin, xmax]
+ Get the y-axis range [*ymin*, *ymax*]
"""
return self.viewLim.intervaly
@@ -1880,11 +1941,11 @@
Keyword arguments:
- ymin: scalar
+ *ymin*: scalar
the min of the ylim
- ymax: scalar
+ *ymax*: scalar
the max of the ylim
- emit: [ True | False ]
+ *emit*: [ True | False ]
notify observers of lim change
Returns the current ylimits as a length 2 tuple
@@ -1950,13 +2011,13 @@
def set_yticks(self, ticks, minor=False):
"""
- Set the y ticks with list of ticks
+ Set the y ticks with list of *ticks*
ACCEPTS: sequence of floats
Keyword arguments:
- minor: [ False | True ]
+ *minor*: [ False | True ]
Sets the minor ticks if True
"""
return self.yaxis.set_ticks(ticks, minor=minor)
@@ -1979,10 +2040,11 @@
set_yticklabels(labels, fontdict=None, minor=False, **kwargs)
- Set the ytick labels with list of strings labels. Return a list of
- Text instances.
+ Set the ytick labels with list of strings *labels*. Return a list of
+ :class:`~matplotlib.text.Text` instances.
- kwargs set Text properties for the labels. Valid properties are
+ *kwargs* set :class:`~matplotlib.text.Text` properties for the labels.
+ Valid properties are
%(Text)s
ACCEPTS: sequence of strings
@@ -1993,7 +2055,7 @@
def xaxis_date(self, tz=None):
"""Sets up x-axis ticks and labels that treat the x data as dates.
- tz is the time zone to use in labeling dates. Defaults to rc value.
+ *tz* is the time zone to use in labeling dates. Defaults to rc value.
"""
if self.ignore_existing_data_limits:
@@ -2022,7 +2084,7 @@
def yaxis_date(self, tz=None):
"""Sets up y-axis ticks and labels that treat the y data as dates.
- tz is the time zone to use in labeling dates. Defaults to rc value.
+ *tz* is the time zone to use in labeling dates. Defaults to rc value.
"""
if self.ignore_existing_data_limits:
# no data has been added - let's set the default datalim.
@@ -2050,7 +2112,7 @@
def format_xdata(self, x):
"""
- Return x string formatted. This function will use the attribute
+ Return *x* string formatted. This function will use the attribute
self.fmt_xdata if it is callable, else will fall back on the xaxis
major formatter
"""
@@ -2062,9 +2124,9 @@
def format_ydata(self, y):
"""
- Return y string formatted. This function will use the attribute
- self.fmt_ydata if it is callable, else will fall back on the yaxis
- major formatter
+ Return y string formatted. This function will use the
+ :attr:`fmt_ydata` attribute if it is callable, else will fall
+ back on the yaxis major formatter
"""
try: return self.fmt_ydata(y)
except TypeError:
@@ -2073,7 +2135,7 @@
return val
def format_coord(self, x, y):
- 'return a format string formatting the x, y coord'
+ 'return a format string formatting the *x*, *y* coord'
if x is None:
x = '???'
if y is None:
@@ -2086,7 +2148,7 @@
def can_zoom(self):
"""
- Return True if this axes support the zoom box
+ Return *True* if this axes support the zoom box
"""
return True
@@ -2113,8 +2175,10 @@
def set_navigate_mode(self, b):
"""
Set the navigation toolbar button status;
- this is not a user-API function.
+ .. warning::
+ this is not a user-API function.
+
"""
self._navigate_mode = b
@@ -2122,14 +2186,15 @@
"""
Called when a pan operation has started.
- x, y are the mouse coordinates in display coords.
+ *x*, *y* are the mouse coordinates in display coords.
button is the mouse button number:
* 1: LEFT
* 2: MIDDLE
* 3: RIGHT
- Intended to be overridden by new projection types.
+ .. note::
+ Intended to be overridden by new projection types.
"""
self._pan_start = cbook.Bunch(
lim = self.viewLim.frozen(),
@@ -2145,7 +2210,8 @@
Called when a pan operation completes (when the mouse button
is up.)
- Intended to be overridden by new projection types.
+ .. note::
+ Intended to be overridden by new projection types.
"""
del self._pan_start
@@ -2153,17 +2219,18 @@
"""
Called when the mouse moves during a pan operation.
- button is the mouse button number:
+ *button* is the mouse button number:
* 1: LEFT
* 2: MIDDLE
* 3: RIGHT
- key is a "shift" key
+ *key* is a "shift" key
- x, y are the mouse coordinates in display coords.
+ *x*, *y* are the mouse coordinates in display coords.
- Intended to be overridden by new projection types.
+ .. note::
+ Intended to be overridden by new projection types.
"""
def format_deltas(key, dx, dy):
if key=='control':
@@ -2217,8 +2284,11 @@
self.set_ylim(*result.intervaly)
def get_cursor_props(self):
- """return the cursor props as a linewidth, color tuple where
- linewidth is a float and color is an RGBA tuple"""
+ """
+ return the cursor propertiess as a (*linewidth*, *color*)
+ tuple, where *linewidth* is a float and *color* is an RGBA
+ tuple
+ """
return self._cursorProps
def set_cursor_props(self, *args):
@@ -2231,7 +2301,7 @@
ax.set_cursor_props((linewidth, color))
- ACCEPTS: a (float, color) tuple
+ ACCEPTS: a (*float*, *color*) tuple
"""
if len(args)==1:
lw, c = args[0]
@@ -2293,10 +2363,12 @@
inside = self.axesPatch.contains(mouseevent.x, mouseevent.y)
return inside,{}
- def pick(self,*args):
+ def pick(self, *args):
"""
- pick(mouseevent)
+ call signature::
+ pick(mouseevent)
+
each child artist will fire a pick event if mouseevent is over
the artist and the artist has picker set
"""
@@ -2307,14 +2379,15 @@
def __pick(self, x, y, trans=None, among=None):
"""
- Return the artist under point that is closest to the x, y. if trans
- is None, x, and y are in window coords, 0,0 = lower left. Otherwise,
- trans is a matplotlib transform that specifies the coordinate system
- of x, y.
+ Return the artist under point that is closest to the *x*, *y*.
+ If *trans* is *None*, *x*, and *y* are in window coords,
+ (0,0 = lower left). Otherwise, *trans* is a
+ :class:`~matplotlib.transforms.Transform` that specifies the
+ coordinate system of *x*, *y*.
The selection of artists from amongst which the pick function
finds an artist can be narrowed using the optional keyword
- argument among. If provided, this should be either a sequence
+ argument *among*. If provided, this should be either a sequence
of permitted artists or a function taking an artist as its
argument and returning a true value if and only if that artist
can be selected.
@@ -2335,7 +2408,7 @@
return math.sqrt((x1-x2)**2+(y1-y2)**2)
def dist_x_y(p1, x, y):
- 'x and y are arrays; return the distance to the closest point'
+ '*x* and *y* are arrays; return the distance to the closest point'
x1, y1 = p1
return min(np.sqrt((x-x1)**2+(y-y1)**2))
@@ -2385,8 +2458,8 @@
set_title(label, fontdict=None, **kwargs):
- Set the title for the axes. See the text docstring for information
- of how override and the optional args work
+ Set the title for the axes. See the :meth:`text` for
+ information of how override and the optional args work
kwargs are Text properties:
%(Text)s
@@ -2419,8 +2492,8 @@
set_xlabel(xlabel, fontdict=None, **kwargs)
- Set the label for the xaxis. See the text docstring for information
- of how override and the optional args work.
+ Set the label for the xaxis. See the :meth:`text` docstring
+ for information of how override and the optional args work.
Valid kwargs are Text properties:
%(Text)s
@@ -2449,8 +2522,8 @@
Set the label for the yaxis
- See the text doctstring for information of how override and
- the optional args work
+ See the :meth:`text` doctstring for information of how
+ override and the optional args work
Valid kwargs are Text properties:
%(Text)s
@@ -3239,7 +3312,7 @@
- *c* is the 2*maxlags+1 auto correlation vector
- *line* is a :class:`~matplotlib.lines.Line2D` instance
- returned by :meth:`plot`
+ returned by :meth:`plot`
The default *linestyle* is None and the default *marker* is
``'o'``, though these can be overridden with keyword args.
@@ -3566,31 +3639,35 @@
======== ===============================================
Argument Description
======== ===============================================
- left the x coordinates of the left sides of the bars
- height the heights of the bars
+ *left* the x coordinates of the left sides of the bars
+ *height* the heights of the bars
======== ===============================================
Optional keyword arguments:
- ============= ===================================================
- Keyword Description
- ============= ===================================================
- width the widths of the bars
- bottom the y coordinates of the bottom edges of the bars
- color the colors of the bars
- edgecolor the colors of the bar edges
- linewidth width of bar edges; None means use default
- linewidth; 0 means don't draw edges.
- xerr and yerr if not None, will be used to generate errorbars
- on the bar chart
- ecolor specifies the color of any errorbar
- capsize (default 3) determines the length in points of the
- error bar caps
- align 'edge' (default) | 'center'
- orientation 'vertical' | 'horizontal'
- log [False|True] False (default) leaves the orientation
- axis as-is; True sets it to log scale
- ============= ===================================================
+ =============== ==========================================
+ Keyword Description
+ =============== ==========================================
+ *width* the widths of the bars
+ *bottom* the y coordinates of the bottom edges of
+ the bars
+ *color* the colors of the bars
+ *edgecolor* the colors of the bar edges
+ *linewidth* width of bar edges; None means use default
+ linewidth; 0 means don't draw edges.
+ *xerr* if not None, will be used to generate
+ errorbars on the bar chart
+ *yerr* if not None, will be used to generate
+ errorbars on the bar chart
+ *ecolor* specifies the color of any errorbar
+ *capsize* (default 3) determines the length in
+ points of the error bar caps
+ *align* 'edge' (default) | 'center'
+ *orientation* 'vertical' | 'horizontal'
+ *log* [False|True] False (default) leaves the
+ orientation axis as-is; True sets it to
+ log scale
+ =============== ==========================================
For vertical bars, *align* = 'edge' aligns bars by their left
edges in left, while *align* = 'center' interprets these
@@ -3818,30 +3895,34 @@
======== ======================================================
Argument Description
======== ======================================================
- bottom the vertical positions of the bottom edges of the bars
- width the lengths of the bars
+ *bottom* the vertical positions of the bottom edges of the bars
+ *width* the lengths of the bars
======== ======================================================
Optional keyword arguments:
- ============= ===================================================
- Keyword Description
- ============= ===================================================
- height the heights (thicknesses) of the bars
- left the x coordinates of the left edges of the bars
- color the colors of the bars
- edgecolor the colors of the bar edges
- linewidth width of bar edges; None means use default
- linewidth; 0 means don't draw edges.
- xerr and yerr if not None, will be used to generate errorbars
- on the bar chart
- ecolor specifies the color of any errorbar
- capsize (default 3) determines the length in points of the
- error bar caps
- align 'edge' (default) | 'center'
- log [False|True] False (default) leaves the horizontal
- axis as-is; True sets it to log scale
- ============= ===================================================
+ =============== ==========================================
+ Keyword Description
+ =============== ==========================================
+ *height* the heights (thicknesses) of the bars
+ *left* the x coordinates of the left edges of the
+ bars
+ *color* the colors of the bars
+ *edgecolor* the colors of the bar edges
+ *linewidth* width of bar edges; None means use default
+ linewidth; 0 means don't draw edges.
+ *xerr* if not None, will be used to generate
+ errorbars on the bar chart
+ *yerr* if not None, will be used to generate
+ errorbars on the bar chart
+ *ecolor* specifies the color of any errorbar
+ *capsize* (default 3) determines the length in
+ points of the error bar caps
+ *align* 'edge' (default) | 'center'
+ *log* [False|True] False (default) leaves the
+ horizontal axis as-is; True sets it to log
+ scale
+ =============== ==========================================
Setting *align* = 'edge' aligns bars by their bottom edges in
bottom, while *align* = 'center' interprets these values as
@@ -3875,12 +3956,12 @@
Required arguments:
- ======== ==========================
- Argument Description
- ======== ==========================
- xranges sequence of (xmin, xwidth)
- yrange sequence of (ymin, ywidth)
- ======== ==========================
+ ========= ==============================
+ Argument Description
+ ========= ==============================
+ *xranges* sequence of (*xmin*, *xwidth*)
+ *yrange* sequence of (*ymin*, *ywidth*)
+ ========= ==============================
kwargs are
:class:`matplotlib.collections.BrokenBarHCollection`
@@ -5640,20 +5721,28 @@
``pcolor(C, **kwargs)`` is equivalent to
``pcolor([0,nc], [0,nr], C, **kwargs)``
- xr, yr specify the ranges of x and y corresponding to the rectangular
- region bounding C. If xr = [x0, x1] and yr = [y0,y1] then
- x goes from x0 to x1 as the second index of C goes from 0 to nc,
- etc. (x0, y0) is the outermost corner of cell (0,0), and (x1, y1)
- is the outermost corner of cell (nr-1, nc-1). All cells are
- rectangles of the same size. This is the fastest version.
+ *xr*, *yr* specify the ranges of *x* and *y* corresponding to the
+ rectangular region bounding *C*. If::
- x, y are 1D arrays of length nc+1 and nr+1, respectively, giving
- the x and y boundaries of the cells. Hence the cells are
+ xr = [x0, x1]
+
+ and::
+
+ yr = [y0,y1]
+
+ then *x* goes from *x0* to *x1* as the second index of *C* goes
+ from 0 to *nc*, etc. (*x0*, *y0*) is the outermost corner of
+ cell (0,0), and (*x1*, *y1*) is the outermost corner of cell
+ (*nr*-1, *nc*-1). All cells are rectangles of the same size.
+ This is the fastest version.
+
+ *x*, *y* are 1D arrays of length *nc* +1 and *nr* +1, respectively,
+ giving the x and y boundaries of the cells. Hence the cells are
rectangular but the grid may be nonuniform. The speed is
intermediate. (The grid is checked, and if found to be
uniform the fast version is used.)
- X and Y are 2D arrays with shape (nr+1, nc+1) that specify
+ *X* and *Y* are 2D arrays with shape (*nr* +1, *nc* +1) that specify
the (x,y) coordinates of the corners of the colored
quadrilaterals; the quadrilateral for C[i,j] has corners at
(X[i,j],Y[i,j]), (X[i,j+1],Y[i,j+1]), (X[i+1,j],Y[i+1,j]),
@@ -5668,17 +5757,17 @@
Optional keyword arguments:
- cmap: [ None | Colormap ]
+ *cmap*: [ None | Colormap ]
A cm Colormap instance from cm. If None, use rc settings.
- norm: [ None | Normalize ]
+ *norm*: [ None | Normalize ]
An mcolors.Normalize instance is used to scale luminance data to
0,1. If None, defaults to normalize()
- vmin/vmax: [ None | scalar ]
- vmin and vmax are used in conjunction with norm to normalize
- luminance data. If either are None, the min and max of the color
- array C is used. If you pass a norm instance, vmin and vmax will
- be None.
- alpha: 0 <= scalar <= 1
+ *vmin*/*vmax*: [ None | scalar ]
+ *vmin* and *vmax* are used in conjunction with norm to normalize
+ luminance data. If either are *None*, the min and max of the color
+ array *C* is used. If you pass a norm instance, *vmin* and *vmax*
+ will be *None*.
+ *alpha*: 0 <= scalar <= 1
the alpha blending value
Return value is an image if a regular or rectangular grid
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ds...@us...> - 2008-06-23 16:17:41
|
Revision: 5649
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5649&view=rev
Author: dsdale
Date: 2008-06-23 09:16:24 -0700 (Mon, 23 Jun 2008)
Log Message:
-----------
artist docstring conversion
Modified Paths:
--------------
trunk/matplotlib/doc/devel/outline.rst
trunk/matplotlib/lib/matplotlib/artist.py
Modified: trunk/matplotlib/doc/devel/outline.rst
===================================================================
--- trunk/matplotlib/doc/devel/outline.rst 2008-06-23 15:49:03 UTC (rev 5648)
+++ trunk/matplotlib/doc/devel/outline.rst 2008-06-23 16:16:24 UTC (rev 5649)
@@ -112,7 +112,7 @@
projections/geo needs conversion
projections/polar needs conversion
afm converted
-artist needs conversion
+artist converted
axes needs conversion
axis needs conversion
backend_bases needs conversion
Modified: trunk/matplotlib/lib/matplotlib/artist.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/artist.py 2008-06-23 15:49:03 UTC (rev 5648)
+++ trunk/matplotlib/lib/matplotlib/artist.py 2008-06-23 16:16:24 UTC (rev 5649)
@@ -81,7 +81,7 @@
# TODO: add legend support
def have_units(self):
- 'return True if units are set on the x or y axes'
+ 'return *True* if units are set on the x or y axes'
ax = self.axes
if ax is None or ax.xaxis is None:
return False
@@ -89,7 +89,7 @@
def convert_xunits(self, x):
"""for artists in an axes, if the xaxis as units support,
- convert x using xaxis unit type
+ convert *x* using xaxis unit type
"""
ax = getattr(self, 'axes', None)
if ax is None or ax.xaxis is None:
@@ -99,7 +99,7 @@
def convert_yunits(self, y):
"""for artists in an axes, if the yaxis as units support,
- convert y using yaxis unit type
+ convert *y* using yaxis unit type
"""
ax = getattr(self, 'axes', None)
if ax is None or ax.yaxis is None: return y
@@ -107,14 +107,14 @@
def set_axes(self, axes):
"""
- set the axes instance the artist resides in, if any
+ set the axes instance in which the artist resides, if any
ACCEPTS: an axes instance
"""
self.axes = axes
def get_axes(self):
- 'return the axes instance the artist resides in, or None'
+ 'return the axes instance the artist resides in, or *None*'
return self.axes
def add_callback(self, func):
@@ -170,7 +170,7 @@
for a in self.get_children(): L.extend(a.hitlist(event))
return L
- def contains(self,mouseevent):
+ def contains(self, mouseevent):
"""Test whether the artist contains the mouse event.
Returns the truth value and a dictionary of artist specific details of
@@ -189,26 +189,28 @@
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
def get_contains(self):
- 'return the _contains test used by the artist, or None for default.'
+ 'return the _contains test used by the artist, or *None* for default.'
return self._contains
def pickable(self):
- 'return True if self is pickable'
+ 'return *True* if self is pickable'
return (self.figure is not None and
self.figure.canvas is not None and
self._picker is not None)
def pick(self, mouseevent):
"""
- pick(mouseevent)
+ call signature::
- each child artist will fire a pick event if mouseevent is over
+ pick(mouseevent)
+
+ each child artist will fire a pick event if *mouseevent* is over
the artist and the artist has picker set
"""
# Pick self
@@ -229,31 +231,31 @@
"""
set the epsilon for picking used by this artist
- picker can be one of the following:
+ *picker* can be one of the following:
- None - picking is disabled for this artist (default)
+ * *None*: picking is disabled for this artist (default)
- boolean - if True then picking will be enabled and the
- artist will fire a pick event if the mouse event is over
- the artist
+ * A 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
- event. For some artists like lines and patch collections,
- the artist may provide additional data to the pick event
- that is generated, eg the indices of the data within
- epsilon of the pick event
+ * A float: if picker is a number it is interpreted as an
+ epsilon tolerance in points and the artist will fire
+ off an event if it's data is within epsilon of the mouse
+ event. For some artists like lines and patch collections,
+ the artist may provide additional data to the pick event
+ that is generated, e.g. the indices of the data within
+ epsilon of the pick event
- function - if picker is callable, it is a user supplied
- function which determines whether the artist is hit by the
- mouse event::
+ * A function: if picker is callable, it is a user supplied
+ function which determines whether the artist is hit by the
+ mouse event::
hit, props = picker(artist, mouseevent)
- to determine the hit test. if the mouse event is over the
- artist, return hit=True and props is a dictionary of
- properties you want added to the PickEvent attributes.
+ to determine the hit test. if the mouse event is over the
+ artist, return *hit=True* and props is a dictionary of
+ properties you want added to the PickEvent attributes.
ACCEPTS: [None|float|boolean|callable]
"""
@@ -263,7 +265,6 @@
'return the Pickeration instance used by this artist'
return self._picker
-
def is_figure_set(self):
return self.figure is not None
@@ -279,7 +280,7 @@
Set the :class:`~matplotlib.figure.Figure` instance the artist
belongs to.
- ACCEPTS: a matplotlib.figure.Figure instance
+ ACCEPTS: a :class:`matplotlib.figure.Figure` instance
"""
self.figure = fig
self.pchanged()
@@ -288,7 +289,7 @@
"""
Set the artist's clip Bbox
- ACCEPTS: a matplotlib.transform.Bbox instance
+ ACCEPTS: a :class:`matplotlib.transform.Bbox` instance
"""
self.clipbox = clipbox
self._clipon = clipbox is not None or self._clippath is not None
@@ -298,21 +299,22 @@
"""
Set the artist's clip path, which may be:
- a) a :class:`~matplotlib.patches.Patch` (or subclass) instance
+ * a :class:`~matplotlib.patches.Patch` (or subclass) instance
- b) a :class:`~matplotlib.path.Path` instance, in which case
+ * a :class:`~matplotlib.path.Path` instance, in which case
an optional :class:`~matplotlib.transforms.Transform`
instance may be provided, which will be applied to the
path before using it for clipping.
- c) *None*, to remove the clipping path
+ * *None*, to remove the clipping path
For efficiency, if the path happens to be an axis-aligned
rectangle, this method will set the clipping box to the
corresponding rectangle and set the clipping path to *None*.
- ACCEPTS: a Path instance and a Transform instance, a Patch
- instance, or None
+ ACCEPTS: a :class:`~matplotlib.path.Path` instance and a
+ :class:`~matplotlib.transforms.Transform` instance, a
+ :class:`~matplotlib.patches.Patch` instance, or *None*.
"""
from patches import Patch, Rectangle
@@ -371,8 +373,9 @@
def get_transformed_clip_path_and_affine(self):
'''
- Return the clip path with the non-affine part of its transformation applied,
- and the remaining affine part of its transformation.
+ Return the clip path with the non-affine part of its
+ transformation applied, and the remaining affine part of its
+ transformation.
'''
if self._clippath is not None:
return self._clippath.get_transformed_path_and_affine()
@@ -459,7 +462,7 @@
def set_label(self, s):
"""
- Set the line label to s for auto legend
+ Set the line label to *s* for auto legend
ACCEPTS: any string
"""
@@ -495,7 +498,7 @@
def set(self, **kwargs):
"""
- A tkstyle set command, pass kwargs to set properties
+ A tkstyle set command, pass *kwargs* to set properties
"""
ret = []
for k,v in kwargs.items():
@@ -526,8 +529,8 @@
def get_aliases(self):
"""
- Get a dict mapping *fullname* -> *alias* for each alias in the
- :class:`~matplotlib.artist.ArtistInspector`.
+ Get a dict mapping *fullname* -> *alias* for each *alias* in
+ the :class:`~matplotlib.artist.ArtistInspector`.
Eg., for lines::
@@ -553,7 +556,7 @@
"""
Get the legal arguments for the setter associated with *attr*.
- This is done by querying the docstring of the function set_ *attr*
+ This is done by querying the docstring of the function *set_attr*
for a line that begins with ACCEPTS:
Eg., for a line linestyle, return
@@ -603,11 +606,11 @@
def aliased_name(self, s):
"""
- return 'PROPNAME or alias' if s has an alias, else return
+ return 'PROPNAME or alias' if *s* has an alias, else return
PROPNAME.
- Eg for the line markerfacecolor property, which has an alias,
- return 'markerfacecolor or mfc' and for the transform
+ E.g. for the line markerfacecolor property, which has an
+ alias, return 'markerfacecolor or mfc' and for the transform
property, which does not, return 'transform'
"""
if self.aliasd.has_key(s):
@@ -701,11 +704,11 @@
getp can be used to query all the gettable properties with getp(o)
Many properties have aliases for shorter typing, eg 'lw' is an
alias for 'linewidth'. In the output, aliases and full property
- names will be listed as
+ names will be listed as:
property or alias = value
- eg
+ e.g.:
linewidth or lw = 2
"""
@@ -750,7 +753,7 @@
:func:`setp` operates on a single instance or a list of instances.
If you are in query mode introspecting the possible values, only
the first instance in the sequence is used. When actually setting
- values, all the instances will be set. Eg., suppose you have a
+ values, all the instances will be set. E.g., suppose you have a
list of two lines, the following will make both lines thicker and
red::
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ds...@us...> - 2008-06-23 15:51:13
|
Revision: 5648
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5648&view=rev
Author: dsdale
Date: 2008-06-23 08:49:03 -0700 (Mon, 23 Jun 2008)
Log Message:
-----------
converted afm docstrings
Modified Paths:
--------------
trunk/matplotlib/doc/api/index.rst
trunk/matplotlib/doc/devel/outline.rst
trunk/matplotlib/lib/matplotlib/afm.py
Added Paths:
-----------
trunk/matplotlib/doc/api/afm_api.rst
Added: trunk/matplotlib/doc/api/afm_api.rst
===================================================================
--- trunk/matplotlib/doc/api/afm_api.rst (rev 0)
+++ trunk/matplotlib/doc/api/afm_api.rst 2008-06-23 15:49:03 UTC (rev 5648)
@@ -0,0 +1,12 @@
+**************
+matplotlib afm
+**************
+
+
+:mod:`matplotlib.afm`
+=====================
+
+.. automodule:: matplotlib.afm
+ :members:
+ :undoc-members:
+ :show-inheritance:
Modified: trunk/matplotlib/doc/api/index.rst
===================================================================
--- trunk/matplotlib/doc/api/index.rst 2008-06-23 15:26:52 UTC (rev 5647)
+++ trunk/matplotlib/doc/api/index.rst 2008-06-23 15:49:03 UTC (rev 5648)
@@ -12,6 +12,7 @@
.. toctree::
matplotlib_configuration_api.rst
+ afm_api.rst
artist_api.rst
figure_api.rst
axes_api.rst
Modified: trunk/matplotlib/doc/devel/outline.rst
===================================================================
--- trunk/matplotlib/doc/devel/outline.rst 2008-06-23 15:26:52 UTC (rev 5647)
+++ trunk/matplotlib/doc/devel/outline.rst 2008-06-23 15:49:03 UTC (rev 5648)
@@ -111,7 +111,7 @@
projections/__init__ needs conversion
projections/geo needs conversion
projections/polar needs conversion
-afm needs conversion
+afm converted
artist needs conversion
axes needs conversion
axis needs conversion
Modified: trunk/matplotlib/lib/matplotlib/afm.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/afm.py 2008-06-23 15:26:52 UTC (rev 5647)
+++ trunk/matplotlib/lib/matplotlib/afm.py 2008-06-23 15:49:03 UTC (rev 5648)
@@ -11,7 +11,7 @@
3) Did more than I needed and it was easier to write my own than
figure out how to just get what I needed from theirs
-It is pretty easy to use, and requires only built-in python libs
+It is pretty easy to use, and requires only built-in python libs:
>>> from afm import AFM
>>> fh = file('ptmr8a.afm')
@@ -31,7 +31,7 @@
AUTHOR:
- John D. Hunter <jdh...@ac...>
+ John D. Hunter <jd...@gm...>
"""
import sys, os
@@ -56,7 +56,7 @@
def _sanity_check(fh):
"""
Check if the file at least looks like AFM.
- If not, raise RuntimeError.
+ If not, raise :exc:`RuntimeError`.
"""
# Remember the file position in case the caller wants to
@@ -77,10 +77,13 @@
def _parse_header(fh):
"""
Reads the font metrics header (up to the char metrics) and returns
- a dictionary mapping key to val. val will be converted to the
- appropriate python type as necessary; eg 'False'->False, '0'->0,
- '-168 -218 1000 898'-> [-168, -218, 1000, 898]
+ a dictionary mapping *key* to *val*. *val* will be converted to the
+ appropriate python type as necessary; eg:
+ * 'False'->False
+ * '0'->0
+ * '-168 -218 1000 898'-> [-168, -218, 1000, 898]
+
Dictionary keys are
StartFontMetrics, FontName, FullName, FamilyName, Weight,
@@ -142,14 +145,12 @@
def _parse_char_metrics(fh):
"""
Return a character metric dictionary. Keys are the ASCII num of
- the character, values are a (wx, name, bbox) tuple, where
+ the character, values are a (*wx*, *name*, *bbox*) tuple, where
+ *wx* is the character width, *name* is the postscript language
+ name, and *bbox* is a (*llx*, *lly*, *urx*, *ury*) tuple.
- wx is the character width
- name is the postscript language name
- bbox (llx, lly, urx, ury)
-
- This function is incomplete per the standard, but thus far parse
- all the sample afm files I have
+ This function is incomplete per the standard, but thus far parses
+ all the sample afm files tried.
"""
ascii_d = {}
@@ -176,13 +177,12 @@
def _parse_kern_pairs(fh):
"""
- Return a kern pairs dictionary; keys are (char1, char2) tuples and
+ Return a kern pairs dictionary; keys are (*char1*, *char2*) tuples and
values are the kern pair value. For example, a kern pairs line like
+ ``KPX A y -50``
- KPX A y -50
+ will be represented as::
- will be represented as
-
d[ ('A', 'y') ] = -50
"""
@@ -210,13 +210,13 @@
def _parse_composites(fh):
"""
Return a composites dictionary. Keys are the names of the
- composites. vals are a num parts list of composite information,
- with each element being a (name, dx, dy) tuple. Thus if a
+ composites. Values are a num parts list of composite information,
+ with each element being a (*name*, *dx*, *dy*) tuple. Thus a
composites line reading:
CC Aacute 2 ; PCC A 0 0 ; PCC acute 160 170 ;
- will be represented as
+ will be represented as::
d['Aacute'] = [ ('A', 0, 0), ('acute', 160, 170) ]
@@ -245,9 +245,10 @@
"""
Parse the optional fields for kern pair data and composites
- return value is a kernDict, compositeDict which are the return
- values from parse_kern_pairs, and parse_composites if the data
- exists, or empty dicts otherwise
+ return value is a (*kernDict*, *compositeDict*) which are the
+ return values from :func:`_parse_kern_pairs`, and
+ :func:`_parse_composites` if the data exists, or empty dicts
+ otherwise
"""
optional = {
'StartKernData' : _parse_kern_pairs,
@@ -269,13 +270,12 @@
def parse_afm(fh):
"""
- Parse the Adobe Font Metics file in file handle fh
- Return value is a (dhead, dcmetrics, dkernpairs, dcomposite) tuple where
-
- dhead : a parse_header dict
- dcmetrics : a parse_composites dict
- dkernpairs : a parse_kern_pairs dict, possibly {}
- dcomposite : a parse_composites dict , possibly {}
+ Parse the Adobe Font Metics file in file handle *fh*. Return value
+ is a (*dhead*, *dcmetrics*, *dkernpairs*, *dcomposite*) tuple where
+ *dhead* is a :func:`_parse_header` dict, *dcmetrics* is a
+ :func:`_parse_composites` dict, *dkernpairs* is a
+ :func:`_parse_kern_pairs` dict (possibly {}), and *dcomposite* is a
+ :func:`_parse_composites` dict (possibly {})
"""
_sanity_check(fh)
dhead = _parse_header(fh)
@@ -288,7 +288,7 @@
def __init__(self, fh):
"""
- Parse the AFM file in file object fh
+ Parse the AFM file in file object *fh*
"""
(dhead, dcmetrics_ascii, dcmetrics_name, dkernpairs, dcomposite) = \
parse_afm(fh)
@@ -307,7 +307,7 @@
def string_width_height(self, s):
"""
Return the string width (including kerning) and string height
- as a w,h tuple
+ as a (*w*, *h*) tuple.
"""
if not len(s): return 0,0
totalw = 0
@@ -404,8 +404,8 @@
def get_height_char(self, c, isord=False):
"""
- Get the height of character c from the bounding box. This is
- the ink height (space is 0)
+ Get the height of character *c* from the bounding box. This
+ is the ink height (space is 0)
"""
if not isord: c=ord(c)
wx, name, bbox = self._metrics[c]
@@ -413,30 +413,30 @@
def get_kern_dist(self, c1, c2):
"""
- Return the kerning pair distance (possibly 0) for chars c1 and
- c2
+ Return the kerning pair distance (possibly 0) for chars *c1*
+ and *c2*
"""
name1, name2 = self.get_name_char(c1), self.get_name_char(c2)
return self.get_kern_dist_from_name(name1, name2)
def get_kern_dist_from_name(self, name1, name2):
"""
- Return the kerning pair distance (possibly 0) for chars c1 and
- c2
+ Return the kerning pair distance (possibly 0) for chars
+ *name1* and *name2*
"""
try: return self._kern[ (name1, name2) ]
except: return 0
def get_fontname(self):
- "Return the font name, eg, Times-Roman"
+ "Return the font name, eg, 'Times-Roman'"
return self._header['FontName']
def get_fullname(self):
- "Return the font full name, eg, Times-Roman"
+ "Return the font full name, eg, 'Times-Roman'"
return self._header['FullName']
def get_familyname(self):
- "Return the font family name, eg, Times"
+ "Return the font family name, eg, 'Times'"
return self._header['FamilyName']
def get_weight(self):
@@ -461,14 +461,14 @@
def get_horizontal_stem_width(self):
"""
- Return the standard horizontal stem width as float, or None if
+ Return the standard horizontal stem width as float, or *None* if
not specified in AFM file.
"""
return self._header.get('StdHW', None)
def get_vertical_stem_width(self):
"""
- Return the standard vertical stem width as float, or None if
+ Return the standard vertical stem width as float, or *None* if
not specified in AFM file.
"""
return self._header.get('StdVW', None)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ds...@us...> - 2008-06-23 15:28:36
|
Revision: 5647
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5647&view=rev
Author: dsdale
Date: 2008-06-23 08:26:52 -0700 (Mon, 23 Jun 2008)
Log Message:
-----------
added table for tracking docstring conversion progress
Modified Paths:
--------------
trunk/matplotlib/doc/devel/documenting_mpl.rst
trunk/matplotlib/doc/devel/outline.rst
Modified: trunk/matplotlib/doc/devel/documenting_mpl.rst
===================================================================
--- trunk/matplotlib/doc/devel/documenting_mpl.rst 2008-06-23 15:23:22 UTC (rev 5646)
+++ trunk/matplotlib/doc/devel/documenting_mpl.rst 2008-06-23 15:26:52 UTC (rev 5647)
@@ -52,6 +52,8 @@
.. include:: ../../TODO
+.. _formatting-mpl-docs:
+
Formatting
==========
Modified: trunk/matplotlib/doc/devel/outline.rst
===================================================================
--- trunk/matplotlib/doc/devel/outline.rst 2008-06-23 15:23:22 UTC (rev 5646)
+++ trunk/matplotlib/doc/devel/outline.rst 2008-06-23 15:26:52 UTC (rev 5647)
@@ -9,63 +9,148 @@
(though in some cases it will be), it may be a chapter or a section in
a chapter.
-=============================== ==================== =========== ===================
-User's guide unit Author Status Reviewer
-=============================== ==================== =========== ===================
-plotting 2-D arrays Eric has author Perry ? Darren
-colormapping Eric has author ?
-quiver plots Eric has author ?
-histograms Manuel ? no author Erik Tollerud ?
-bar / errorbar ? no author ?
-x-y plots ? no author Darren
-time series plots ? no author ?
-date plots John has author ?
-working with data John has author Darren
-custom ticking ? no author ?
-masked data Eric has author ?
-patches ? no author ?
-legends ? no author ?
-animation John has author ?
-collections ? no author ?
-text - mathtext Michael accepted John
-text - usetex Darren accepted John
-text - annotations John submitted ?
-fonts et al Michael ? no author Darren
-pyplot tut John submitted Eric
-configuration Darren submitted ?
-win32 install Charlie ? no author Darren
-os x install Charlie ? no author ?
-linux install Darren has author ?
-artist api John submitted ?
-event handling John submitted ?
-navigation John submitted ?
-interactive usage ? no author ?
-widgets ? no author ?
-ui - gtk ? no author ?
-ui - wx ? no author ?
-ui - tk ? no author ?
-ui - qt Darren has author ?
-backend - pdf Jouni ? no author ?
-backend - ps Darren has author ?
-backend - svg ? no author ?
-backend - agg ? no author ?
-backend - cairo ? no author ?
-=============================== ==================== =========== ===================
+======================== ================== ========== ===================
+User's guide unit Author Status Reviewer
+======================== ================== ========== ===================
+plotting 2-D arrays Eric has author Perry ? Darren
+colormapping Eric has author ?
+quiver plots Eric has author ?
+histograms Manuel ? no author Erik Tollerud ?
+bar / errorbar ? no author ?
+x-y plots ? no author Darren
+time series plots ? no author ?
+date plots John has author ?
+working with data John has author Darren
+custom ticking ? no author ?
+masked data Eric has author ?
+patches ? no author ?
+legends ? no author ?
+animation John has author ?
+collections ? no author ?
+text - mathtext Michael accepted John
+text - usetex Darren accepted John
+text - annotations John submitted ?
+fonts et al Michael ? no author Darren
+pyplot tut John submitted Eric
+configuration Darren submitted ?
+win32 install Charlie ? no author Darren
+os x install Charlie ? no author ?
+linux install Darren has author ?
+artist api John submitted ?
+event handling John submitted ?
+navigation John submitted ?
+interactive usage ? no author ?
+widgets ? no author ?
+ui - gtk ? no author ?
+ui - wx ? no author ?
+ui - tk ? no author ?
+ui - qt Darren has author ?
+backend - pdf Jouni ? no author ?
+backend - ps Darren has author ?
+backend - svg ? no author ?
+backend - agg ? no author ?
+backend - cairo ? no author ?
+======================== ================== ========== ===================
Here is the ouline for the dev guide, much less fleshed out
-=============================== ==================== =========== ===================
-Developer's guide unit Author Status Reviewer
-=============================== ==================== =========== ===================
-the renderer John has author Michael ?
-the canvas John has author ?
-the artist John has author ?
-transforms Michael submitted John
-documenting mpl Darren submitted John, Eric, Mike?
-coding guide John complete Eric
-and_much_more ? ? ?
-=============================== ==================== =========== ===================
+========================== =============== =========== ==================
+Developer's guide unit Author Status Reviewer
+========================== =============== =========== ==================
+the renderer John has author Michael ?
+the canvas John has author ?
+the artist John has author ?
+transforms Michael submitted John
+documenting mpl Darren submitted John, Eric, Mike?
+coding guide John complete Eric
+and_much_more ? ? ?
+========================== =============== =========== ==================
+We also have some work to do converting docstrings to ReST for the API
+Reference. Please be sure to follow the few guidelines described in
+:ref:`formatting-mpl-docs`. Once it is converted, please include the module in
+the API documentation and update the status in the table to "converted". Once
+docstring conversion is complete and all the modules are available in the docs,
+we can figure out how best to organize the API Reference and continue from
+there.
+
+==================== =========== ===================
+Module Author Status
+==================== =========== ===================
+backend_agg needs conversion
+backend_cairo needs conversion
+backend_cocoa needs conversion
+backend_emf needs conversion
+backend_fltkagg needs conversion
+backend_gdk needs conversion
+backend_gtk needs conversion
+backend_gtkagg needs conversion
+backend_gtkcairo needs conversion
+backend_mixed needs conversion
+backend_pdf needs conversion
+backend_ps Darren needs conversion
+backend_qt Darren needs conversion
+backend_qtagg Darren needs conversion
+backend_qt4 Darren needs conversion
+backend_qt4agg Darren needs conversion
+backend_svg needs conversion
+backend_template needs conversion
+backend_tkagg needs conversion
+backend_wx needs conversion
+backend_wxagg needs conversion
+backends/tkagg needs conversion
+config/checkdep Darren needs conversion
+config/cutils Darren needs conversion
+config/mplconfig Darren needs conversion
+config/mpltraits Darren needs conversion
+config/rcparams Darren needs conversion
+config/rcsetup Darren needs conversion
+config/tconfig Darren needs conversion
+config/verbose Darren needs conversion
+numerix/__init__ needs conversion
+projections/__init__ needs conversion
+projections/geo needs conversion
+projections/polar needs conversion
+afm needs conversion
+artist needs conversion
+axes needs conversion
+axis needs conversion
+backend_bases needs conversion
+cbook needs conversion
+cm needs conversion
+collections needs conversion
+colorbar needs conversion
+colors Darren needs conversion
+contour needs conversion
+dates Darren needs conversion
+dviread Darren needs conversion
+figure Darren needs conversion
+finance Darren needs conversion
+font_manager Mike needs conversion
+fontconfig_pattern Mike needs conversion
+image needs conversion
+legend needs conversion
+lines needs conversion
+mathtext needs conversion
+mlab needs conversion
+mpl needs conversion
+patches needs conversion
+path needs conversion
+pylab needs conversion
+pyplot needs conversion
+quiver needs conversion
+rcsetup needs conversion
+scale needs conversion
+table needs conversion
+texmanager Darren needs conversion
+text Mike needs conversion
+ticker Mike needs conversion
+transforms needs conversion
+type1font needs conversion
+units needs conversion
+widgets needs conversion
+==================== =========== ===================
+
And we might want to do a similar table for the FAQ, but that may also be overkill...
If you agree to author a unit, remove the question mark by your name
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-06-23 15:23:58
|
Revision: 5646
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5646&view=rev
Author: mdboom
Date: 2008-06-23 08:23:22 -0700 (Mon, 23 Jun 2008)
Log Message:
-----------
Fix inheritance diagram regular expression parsing.
Modified Paths:
--------------
trunk/matplotlib/doc/sphinxext/inheritance_diagram.py
Modified: trunk/matplotlib/doc/sphinxext/inheritance_diagram.py
===================================================================
--- trunk/matplotlib/doc/sphinxext/inheritance_diagram.py 2008-06-23 14:46:13 UTC (rev 5645)
+++ trunk/matplotlib/doc/sphinxext/inheritance_diagram.py 2008-06-23 15:23:22 UTC (rev 5646)
@@ -31,6 +31,7 @@
import inspect
import os
+import re
import subprocess
try:
from hashlib import md5
@@ -42,7 +43,6 @@
from sphinx.latexwriter import LaTeXTranslator
from docutils.parsers.rst import directives
from sphinx.roles import xfileref_role
-from sphinx.directives.desc import py_sig_re
class DotException(Exception):
pass
@@ -67,12 +67,16 @@
raise ValueError("No classes found for inheritance diagram")
self.show_builtins = show_builtins
+ py_sig_re = re.compile(r'''^([\w.]*\.)? # class names
+ (\w+) \s* $ # optionally arguments
+ ''', re.VERBOSE)
+
def _import_class_or_module(self, name):
"""
Import a class using its fully-qualified *name*.
"""
try:
- path, base, signature = py_sig_re.match(name).groups()
+ path, base = self.py_sig_re.match(name).groups()
except:
raise ValueError(
"Invalid class or module '%s' specified for inheritance diagram" % name)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-06-23 14:47:23
|
Revision: 5645
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5645&view=rev
Author: jdh2358
Date: 2008-06-23 07:46:13 -0700 (Mon, 23 Jun 2008)
Log Message:
-----------
commited olle's linestyle patch patch
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/patches.py
Modified: trunk/matplotlib/lib/matplotlib/patches.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/patches.py 2008-06-23 12:58:30 UTC (rev 5644)
+++ trunk/matplotlib/lib/matplotlib/patches.py 2008-06-23 14:46:13 UTC (rev 5645)
@@ -55,6 +55,7 @@
edgecolor=None,
facecolor=None,
linewidth=None,
+ linestyle=None,
antialiased = None,
hatch = None,
fill=True,
@@ -67,11 +68,13 @@
artist.Artist.__init__(self)
if linewidth is None: linewidth = mpl.rcParams['patch.linewidth']
+ if linestyle is None: linestyle = "solid"
if antialiased is None: antialiased = mpl.rcParams['patch.antialiased']
self.set_edgecolor(edgecolor)
self.set_facecolor(facecolor)
self.set_linewidth(linewidth)
+ self.set_linestyle(linestyle)
self.set_antialiased(antialiased)
self.set_hatch(hatch)
self.fill = fill
@@ -118,6 +121,7 @@
self.set_fill(other.get_fill())
self.set_hatch(other.get_hatch())
self.set_linewidth(other.get_linewidth())
+ self.set_linestyle(other.get_linestyle)
self.set_transform(other.get_data_transform())
self.set_figure(other.get_figure())
self.set_alpha(other.get_alpha())
@@ -149,6 +153,10 @@
def get_linewidth(self):
return self._linewidth
get_lw = get_linewidth
+
+ def get_linestyle(self):
+ return self._linestyle
+ get_ls = get_linestyle
def set_antialiased(self, aa):
"""
@@ -189,7 +197,17 @@
if w is None: w = mpl.rcParams['patch.linewidth']
self._linewidth = w
set_lw = set_linewidth
+
+ def set_linestyle(self, ls):
+ """
+ Set the patch linestyle
+ ACCEPTS: ['solid' | 'dashed' | 'dashdot' | 'dotted']
+ """
+ if ls is None: ls = "solid"
+ self._linestyle = ls
+ set_ls = set_linestyle
+
def set_fill(self, b):
"""
Set whether to fill the patch
@@ -243,6 +261,7 @@
else:
gc.set_foreground(self._edgecolor)
gc.set_linewidth(self._linewidth)
+ gc.set_linestyle(self._linestyle)
gc.set_alpha(self._alpha)
gc.set_antialiased(self._antialiased)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-06-23 12:58:33
|
Revision: 5644
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5644&view=rev
Author: mdboom
Date: 2008-06-23 05:58:30 -0700 (Mon, 23 Jun 2008)
Log Message:
-----------
Fix docstrings.
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/collections.py
Modified: trunk/matplotlib/lib/matplotlib/collections.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/collections.py 2008-06-23 12:52:01 UTC (rev 5643)
+++ trunk/matplotlib/lib/matplotlib/collections.py 2008-06-23 12:58:30 UTC (rev 5644)
@@ -820,6 +820,7 @@
self._sizes = sizes
self.set_transform(transforms.IdentityTransform())
self._paths = [mpath.Path.unit_circle()]
+ __init__.__doc__ = cbook.dedent(__init__.__doc__) % artist.kwdocd
def draw(self, renderer):
# sizes is the area of the circle circumscribing the polygon
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-06-23 12:52:49
|
Revision: 5643
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5643&view=rev
Author: mdboom
Date: 2008-06-23 05:52:01 -0700 (Mon, 23 Jun 2008)
Log Message:
-----------
Fix docstrings.
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/path.py
Modified: trunk/matplotlib/lib/matplotlib/path.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/path.py 2008-06-23 12:44:28 UTC (rev 5642)
+++ trunk/matplotlib/lib/matplotlib/path.py 2008-06-23 12:52:01 UTC (rev 5643)
@@ -19,8 +19,8 @@
closed, line and curve segments.
The underlying storage is made up of two parallel numpy arrays:
- - vertices: an Nx2 float array of vertices
- - codes: an N-length uint8 array of vertex types
+ - *vertices*: an Nx2 float array of vertices
+ - *codes*: an N-length uint8 array of vertex types
These two arrays always have the same length in the first
dimension. For example, to represent a cubic curve, you must
@@ -52,9 +52,10 @@
Users of Path objects should not access the vertices and codes
arrays directly. Instead, they should use :meth:`iter_segments`
- to get the vertex/code pairs. This is important since many Paths,
- as an optimization, do not store a codes array at all, but have a
- default one provided for them by :meth:`iter_segments`.
+ to get the vertex/code pairs. This is important, since many
+ :class:`Path`s, as an optimization, do not store a codes array at
+ all, but have a default one provided for them by
+ :meth:`iter_segments`.
"""
# Path codes
@@ -73,19 +74,20 @@
"""
Create a new path with the given vertices and codes.
- vertices is an Nx2 numpy float array, masked array or Python
+ *vertices* is an Nx2 numpy float array, masked array or Python
sequence.
- codes is an N-length numpy array or Python sequence of type
- Path.code_type.
+ *codes* is an N-length numpy array or Python sequence of type
+ :attr:`matplotlib.path.Path.code_type`.
These two arrays must have the same length in the first
dimension.
- If codes is None, vertices will be treated as a series of line
- segments. If vertices contains masked values, the resulting
- path will be compressed, with MOVETO codes inserted in the
- correct places to jump over the masked regions.
+ If *codes* is None, *vertices* will be treated as a series of
+ line segments. If *vertices* contains masked values, the
+ resulting path will be compressed, with ``MOVETO`` codes
+ inserted in the correct places to jump over the masked
+ regions.
"""
if ma.isMaskedArray(vertices):
is_mask = True
@@ -219,10 +221,10 @@
def contains_point(self, point, transform=None):
"""
- Returns True if the path contains the given point.
+ Returns *True* if the path contains the given point.
- If transform is not None, the path will be transformed before
- performing the test.
+ If *transform* is not *None*, the path will be transformed
+ before performing the test.
"""
if transform is not None:
transform = transform.frozen()
@@ -230,10 +232,10 @@
def contains_path(self, path, transform=None):
"""
- Returns True if this path completely contains the given path.
+ Returns *True* if this path completely contains the given path.
- If transform is not None, the path will be transformed before
- performing the test.
+ If *transform* is not *None*, the path will be transformed
+ before performing the test.
"""
if transform is not None:
transform = transform.frozen()
@@ -241,9 +243,10 @@
def get_extents(self, transform=None):
"""
- Returns the extents (xmin, ymin, xmax, ymax) of the path.
+ Returns the extents (*xmin*, *ymin*, *xmax*, *ymax*) of the
+ path.
- Unlike computing the extents on the vertices alone, this
+ Unlike computing the extents on the *vertices* alone, this
algorithm will take into account the curves and deal with
control points appropriately.
"""
@@ -254,13 +257,13 @@
def intersects_path(self, other):
"""
- Returns True if this path intersects another given path.
+ Returns *True* if this path intersects another given path.
"""
return path_intersects_path(self, other)
def intersects_bbox(self, bbox):
"""
- Returns True if this path intersects a given
+ Returns *True* if this path intersects a given
:class:`~matplotlib.transforms.Bbox`.
"""
from transforms import BboxTransformTo
@@ -271,8 +274,8 @@
def interpolated(self, steps):
"""
- Returns a new path resampled to length N x steps.
- Does not currently handle interpolating curves.
+ Returns a new path resampled to length N x steps. Does not
+ currently handle interpolating curves.
"""
vertices = simple_linear_interpolation(self.vertices, steps)
codes = self.codes
@@ -291,9 +294,9 @@
displaying in backends that do not support compound paths or
Bezier curves, such as GDK.
- If width and height are both non-zero then the lines will be
- simplified so that vertices outside of (0, 0), (width, height)
- will be clipped.
+ If *width* and *height* are both non-zero then the lines will
+ be simplified so that vertices outside of (0, 0), (width,
+ height) will be clipped.
"""
if len(self.vertices) == 0:
return []
@@ -329,8 +332,8 @@
def unit_regular_polygon(cls, numVertices):
"""
(staticmethod) Returns a :class:`Path` for a unit regular
- polygon with the given numVertices and radius of 1.0, centered
- at (0, 0).
+ polygon with the given *numVertices* and radius of 1.0,
+ centered at (0, 0).
"""
if numVertices <= 16:
path = cls._unit_regular_polygons.get(numVertices)
@@ -451,11 +454,11 @@
def arc(cls, theta1, theta2, n=None, is_wedge=False):
"""
(staticmethod) Returns an arc on the unit circle from angle
- theta1 to angle theta2 (in degrees).
+ *theta1* to angle *theta2* (in degrees).
- If n is provided, it is the number of spline segments to make.
- If n is not provided, the number of spline segments is
- determined based on the delta between theta1 and theta2.
+ If *n* is provided, it is the number of spline segments to make.
+ If *n* is not provided, the number of spline segments is
+ determined based on the delta between *theta1* and *theta2*.
Masionobe, L. 2003. `Drawing an elliptical arc using
polylines, quadratic or cubic Bezier curves
@@ -530,7 +533,11 @@
def wedge(cls, theta1, theta2, n=None):
"""
(staticmethod) Returns a wedge of the unit circle from angle
- theta1 to angle theta2 (in degrees).
+ *theta1* to angle *theta2* (in degrees).
+
+ If *n* is provided, it is the number of spline segments to make.
+ If *n* is not provided, the number of spline segments is
+ determined based on the delta between *theta1* and *theta2*.
"""
return cls.arc(theta1, theta2, n, True)
wedge = classmethod(wedge)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-06-23 12:45:06
|
Revision: 5642
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5642&view=rev
Author: mdboom
Date: 2008-06-23 05:44:28 -0700 (Mon, 23 Jun 2008)
Log Message:
-----------
Fix some docstrings.
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/axes.py
trunk/matplotlib/lib/matplotlib/figure.py
Modified: trunk/matplotlib/lib/matplotlib/axes.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axes.py 2008-06-23 12:34:45 UTC (rev 5641)
+++ trunk/matplotlib/lib/matplotlib/axes.py 2008-06-23 12:44:28 UTC (rev 5642)
@@ -4567,7 +4567,7 @@
*style*:
the style of the regular symbol:
- ===== ==================
+ ===== =========================================
Value Description
===== =========================================
0 a regular polygon
Modified: trunk/matplotlib/lib/matplotlib/figure.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/figure.py 2008-06-23 12:34:45 UTC (rev 5641)
+++ trunk/matplotlib/lib/matplotlib/figure.py 2008-06-23 12:44:28 UTC (rev 5642)
@@ -211,7 +211,8 @@
*figurePatch*
a :class:`matplotlib.patches.Rectangle` instance
- *suppressComposite
+
+ *suppressComposite*
for multiple figure images, the figure will make composite
images depending on the renderer option_image_nocomposite
function. If suppressComposite is True|False, this will
@@ -771,7 +772,7 @@
toolbar.update()
self._axstack.clear()
self._seen = {}
- self.artists = []
+ self.artists = []
self.lines = []
self.patches = []
self.texts=[]
@@ -800,7 +801,7 @@
for p in self.patches: p.draw(renderer)
for l in self.lines: l.draw(renderer)
for a in self.artists: a.draw(renderer)
-
+
# override the renderer default if self.suppressComposite
# is not None
composite = renderer.option_image_nocomposite()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-06-23 12:35:16
|
Revision: 5641
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5641&view=rev
Author: mdboom
Date: 2008-06-23 05:34:45 -0700 (Mon, 23 Jun 2008)
Log Message:
-----------
Use splines to render circles in scatter plots.
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
trunk/matplotlib/lib/matplotlib/axes.py
trunk/matplotlib/lib/matplotlib/collections.py
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2008-06-23 12:10:31 UTC (rev 5640)
+++ trunk/matplotlib/CHANGELOG 2008-06-23 12:34:45 UTC (rev 5641)
@@ -1,3 +1,5 @@
+2008-06-23 Use splines to render circles in scatter plots - MGD
+
===============================================================
2008-06-22 Released 0.98.1 at revision 5637
Modified: trunk/matplotlib/lib/matplotlib/axes.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axes.py 2008-06-23 12:10:31 UTC (rev 5640)
+++ trunk/matplotlib/lib/matplotlib/axes.py 2008-06-23 12:34:45 UTC (rev 5641)
@@ -4561,22 +4561,23 @@
The marker can also be a tuple (*numsides*, *style*,
*angle*), which will create a custom, regular symbol.
- *numsides*:
- the number of sides
+ *numsides*:
+ the number of sides
- *style*:
- the style of the regular symbol:
+ *style*:
+ the style of the regular symbol:
- ===== ==================
- Value Description
- ===== ==================
- 0 a regular polygon
- 1 a star-like symbol
- 2 an asterisk
- ===== ==================
+ ===== ==================
+ Value Description
+ ===== =========================================
+ 0 a regular polygon
+ 1 a star-like symbol
+ 2 an asterisk
+ 3 a circle (numsides and angle is ignored)
+ ===== =========================================
- *angle*:
- the angle of rotation of the symbol
+ *angle*:
+ the angle of rotation of the symbol
Finally, *marker* can be (*verts*, 0): *verts* is a
sequence of (*x*, *y*) vertices for a custom scatter
@@ -4640,7 +4641,7 @@
syms = { # a dict from symbol to (numsides, angle)
's' : (4,math.pi/4.0,0), # square
- 'o' : (20,0,0), # circle
+ 'o' : (20,3,0), # circle
'^' : (3,0,0), # triangle up
'>' : (3,math.pi/2.0,0), # triangle right
'v' : (3,math.pi,0), # triangle down
@@ -4748,9 +4749,16 @@
offsets = zip(x,y),
transOffset = self.transData,
)
+ elif symstyle==3:
+ collection = mcoll.CircleCollection(
+ scales,
+ facecolors = colors,
+ edgecolors = edgecolors,
+ linewidths = linewidths,
+ offsets = zip(x,y),
+ transOffset = self.transData,
+ )
else:
- # MGDTODO: This has dpi problems
- # rescale verts
rescale = np.sqrt(max(verts[:,0]**2+verts[:,1]**2))
verts /= rescale
Modified: trunk/matplotlib/lib/matplotlib/collections.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/collections.py 2008-06-23 12:10:31 UTC (rev 5640)
+++ trunk/matplotlib/lib/matplotlib/collections.py 2008-06-23 12:34:45 UTC (rev 5641)
@@ -805,6 +805,32 @@
return self._edgecolors
get_colors = get_color # for compatibility with old versions
+class CircleCollection(Collection):
+ """
+ A collection of circles, drawn using splines.
+ """
+ def __init__(self, sizes):
+ """
+ *sizes*
+ Gives the area of the circle in points^2
+
+ %(Collection)s
+ """
+ Collection.__init__(self,**kwargs)
+ self._sizes = sizes
+ self.set_transform(transforms.IdentityTransform())
+ self._paths = [mpath.Path.unit_circle()]
+
+ def draw(self, renderer):
+ # sizes is the area of the circle circumscribing the polygon
+ # in points^2
+ self._transforms = [
+ transforms.Affine2D().scale(
+ (np.sqrt(x) * renderer.dpi / 72.0) / np.sqrt(np.pi))
+ for x in self._sizes]
+ return Collection.draw(self, renderer)
+
+
class PatchCollection(Collection):
"""
A generic collection of patches.
@@ -870,6 +896,6 @@
artist.kwdocd['Collection'] = patchstr = artist.kwdoc(Collection)
for k in ('QuadMesh', 'PolyCollection', 'BrokenBarHCollection', 'RegularPolyCollection',
- 'StarPolygonCollection'):
+ 'StarPolygonCollection', 'PatchCollection', 'CircleCollection'):
artist.kwdocd[k] = patchstr
artist.kwdocd['LineCollection'] = artist.kwdoc(LineCollection)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-06-23 12:11:37
|
Revision: 5640
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5640&view=rev
Author: mdboom
Date: 2008-06-23 05:10:31 -0700 (Mon, 23 Jun 2008)
Log Message:
-----------
Tagging 0.91.4 release.
Added Paths:
-----------
tags/v0_91_4/
Copied: tags/v0_91_4 (from rev 5638, branches/v0_91_maint)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-06-23 12:07:05
|
Revision: 5639
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5639&view=rev
Author: mdboom
Date: 2008-06-23 05:06:46 -0700 (Mon, 23 Jun 2008)
Log Message:
-----------
Tagging 0.98.1 release.
Added Paths:
-----------
tags/v0_98_1/
Copied: tags/v0_98_1 (from rev 5637, trunk/matplotlib)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <cm...@us...> - 2008-06-23 02:11:13
|
Revision: 5638
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5638&view=rev
Author: cmoad
Date: 2008-06-22 19:11:08 -0700 (Sun, 22 Jun 2008)
Log Message:
-----------
minor rev bump
Modified Paths:
--------------
branches/v0_91_maint/CHANGELOG
Modified: branches/v0_91_maint/CHANGELOG
===================================================================
--- branches/v0_91_maint/CHANGELOG 2008-06-23 01:32:18 UTC (rev 5637)
+++ branches/v0_91_maint/CHANGELOG 2008-06-23 02:11:08 UTC (rev 5638)
@@ -1,3 +1,6 @@
+===============================================================
+2008-06-22 Released 0.91.4 at revision 5638
+
2008-06-09 Don't install Enthought.Traits along with matplotlib. For
matplotlib developers convenience, it can still be
installed by setting an option in setup.cfg while we figure
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <cm...@us...> - 2008-06-23 01:32:25
|
Revision: 5637
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5637&view=rev
Author: cmoad
Date: 2008-06-22 18:32:18 -0700 (Sun, 22 Jun 2008)
Log Message:
-----------
minor rev bump
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2008-06-22 16:32:47 UTC (rev 5636)
+++ trunk/matplotlib/CHANGELOG 2008-06-23 01:32:18 UTC (rev 5637)
@@ -1,3 +1,6 @@
+===============================================================
+2008-06-22 Released 0.98.1 at revision 5637
+
2008-06-22 Removed axes3d support and replaced it with a
NotImplementedError for one release cycle
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|