SF.net SVN: matplotlib: [5393] trunk/toolkits/basemap/examples
Revision: 5393
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5393&view=rev
Author: jswhit
Date: 2008-06-05 04:57:31 -0700 (Thu, 05 Jun 2008)
Log Message:
---
adjust for new num2date defaults.
Modified Paths:
--
trunk/toolkits/basemap/examples/fcstmaps.py
trunk/toolkits/basemap/examples/pnganim.py
Modified: trunk/toolkits/basemap/examples/fcstmaps.py
===
--- trunk/toolkits/basemap/examples/fcstmaps.py 2008-06-05 01:18:55 UTC (rev
5392)
+++ trunk/toolkits/basemap/examples/fcstmaps.py 2008-06-05 11:57:31 UTC (rev
5393)
@@ -37,7 +37,7 @@
times = fcsttimes[0:6] # first 6 forecast times.
ntimes = len(times)
# convert times for datetime instances.
-fdates = num2date(times,fcsttimes.units)
+fdates = num2date(times,units=fcsttimes.units,calendar='standard')
# make a list of MMDDHH strings.
verifdates = [fdate.strftime('%Y%m%d%H') for fdate in fdates]
# convert times to forecast hours.
Modified: trunk/toolkits/basemap/examples/pnganim.py
===
--- trunk/toolkits/basemap/examples/pnganim.py 2008-06-05 01:18:55 UTC (rev
5392)
+++ trunk/toolkits/basemap/examples/pnganim.py 2008-06-05 11:57:31 UTC (rev
5393)
@@ -42,7 +42,7 @@
longitudes = data.variables['lon'][:].tolist()
times = data.variables['time']
# convert numeric time values to datetime objects.
-fdates = num2date(times[:],times.units)
+fdates = num2date(times[:],units=times.units,calendar='standard')
# put times in MMDDHH format.
dates = [fdate.strftime('%Y%m%d%H') for fdate in fdates]
if MMDDHH1 not in dates or MMDDHH2 not in dates:
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
SF.net SVN: matplotlib: [5394] trunk/matplotlib
Revision: 5394 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5394&view=rev Author: mdboom Date: 2008-06-05 06:45:27 -0700 (Thu, 05 Jun 2008) Log Message: --- Add transformations/paths information to developer docs. Modified Paths: -- trunk/matplotlib/doc/conf.py trunk/matplotlib/doc/devel/index.rst trunk/matplotlib/lib/matplotlib/path.py trunk/matplotlib/lib/matplotlib/transforms.py Added Paths: --- trunk/matplotlib/doc/devel/transformations.rst Modified: trunk/matplotlib/doc/conf.py === --- trunk/matplotlib/doc/conf.py2008-06-05 11:57:31 UTC (rev 5393) +++ trunk/matplotlib/doc/conf.py2008-06-05 13:45:27 UTC (rev 5394) @@ -159,3 +159,7 @@ latex_use_modindex = True latex_use_parts = True + +# Show both class-level docstring and __init__ docstring in class +# documentation +autoclass_content = 'both' Modified: trunk/matplotlib/doc/devel/index.rst === --- trunk/matplotlib/doc/devel/index.rst2008-06-05 11:57:31 UTC (rev 5393) +++ trunk/matplotlib/doc/devel/index.rst2008-06-05 13:45:27 UTC (rev 5394) @@ -11,4 +11,6 @@ coding_guide.rst documenting_mpl.rst + transformations.rst add_new_projection.rst + Added: trunk/matplotlib/doc/devel/transformations.rst === --- trunk/matplotlib/doc/devel/transformations.rst (rev 0) +++ trunk/matplotlib/doc/devel/transformations.rst 2008-06-05 13:45:27 UTC (rev 5394) @@ -0,0 +1,21 @@ +== + Working with transformations +== + +:mod:`matplotlib.transforms` += + +.. automodule:: matplotlib.transforms + :members: TransformNode, BboxBase, Bbox, TransformedBbox, Transform, + TransformWrapper, AffineBase, Affine2DBase, Affine2D, IdentityTransform, + BlendedGenericTransform, BlendedAffine2D, blended_transform_factory, + CompositeGenericTransform, CompositeAffine2D, + composite_transform_factory, BboxTransform, BboxTransformTo, + BboxTransformFrom, ScaledTranslation, TransformedPath, nonsingular, + interval_contains, interval_contains_open + +:mod:`matplotlib.path` += + +.. automodule:: matplotlib.path + :members: Path, get_path_collection_extents Modified: trunk/matplotlib/lib/matplotlib/path.py === --- trunk/matplotlib/lib/matplotlib/path.py 2008-06-05 11:57:31 UTC (rev 5393) +++ trunk/matplotlib/lib/matplotlib/path.py 2008-06-05 13:45:27 UTC (rev 5394) @@ -1,7 +1,5 @@ """ Contains a class for managing paths (polylines). - -October 2007 Michael Droettboom """ import math @@ -21,42 +19,42 @@ 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. Therefore, to represent a cubic curve, you must +dimension. For example, to represent a cubic curve, you must provide three vertices as well as three codes "CURVE3". The code types are: - STOP : 1 vertex (ignored) - A marker for the end of the entire path (currently not - required and ignored) + - ``STOP`` : 1 vertex (ignored) + A marker for the end of the entire path (currently not + required and ignored) - MOVETO : 1 vertex - Pick up the pen and move to the given vertex. + - ``MOVETO`` : 1 vertex +Pick up the pen and move to the given vertex. - LINETO : 1 vertex - Draw a line from the current position to the given vertex. + - ``LINETO`` : 1 vertex +Draw a line from the current position to the given vertex. - CURVE3 : 1 control point, 1 endpoint + - ``CURVE3`` : 1 control point, 1 endpoint Draw a quadratic Bezier curve from the current position, with the given control point, to the given end point. - CURVE4 : 2 control points, 1 endpoint + - ``CURVE4`` : 2 control points, 1 endpoint Draw a cubic Bezier curve from the current position, with the given control points, to the given end point. - CLOSEPOLY : 1 vertex (ignored) + - ``CLOSEPOLY`` : 1 vertex (ignored) Draw a line segment to the start point of the current polyline. Users of Path objects should not access the vertices and codes -arrays directly. Instead, they should use iter_segments to get -the ver
SF.net SVN: matplotlib: [5395] trunk/matplotlib
Revision: 5395
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5395&view=rev
Author: jdh2358
Date: 2008-06-05 07:18:31 -0700 (Thu, 05 Jun 2008)
Log Message:
---
some fixes for classic toolbar
Modified Paths:
--
trunk/matplotlib/examples/user_interfaces/embedding_in_gtk2.py
trunk/matplotlib/lib/matplotlib/backends/backend_gtk.py
trunk/matplotlib/lib/matplotlib/backends/backend_tkagg.py
trunk/matplotlib/lib/matplotlib/ticker.py
Modified: trunk/matplotlib/examples/user_interfaces/embedding_in_gtk2.py
===
--- trunk/matplotlib/examples/user_interfaces/embedding_in_gtk2.py
2008-06-05 13:45:27 UTC (rev 5394)
+++ trunk/matplotlib/examples/user_interfaces/embedding_in_gtk2.py
2008-06-05 14:18:31 UTC (rev 5395)
@@ -14,8 +14,8 @@
#from matplotlib.backends.backend_gtkcairo import FigureCanvasGTKCairo as
FigureCanvas
# or NavigationToolbar for classic
-from matplotlib.backends.backend_gtk import NavigationToolbar2GTK as
NavigationToolbar
-#from matplotlib.backends.backend_gtkagg import NavigationToolbar2GTKAgg as
NavigationToolbar
+#from matplotlib.backends.backend_gtk import NavigationToolbar2GTK as
NavigationToolbar
+from matplotlib.backends.backend_gtkagg import NavigationToolbar2GTKAgg as
NavigationToolbar
win = gtk.Window()
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_gtk.py
===
--- trunk/matplotlib/lib/matplotlib/backends/backend_gtk.py 2008-06-05
13:45:27 UTC (rev 5394)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_gtk.py 2008-06-05
14:18:31 UTC (rev 5395)
@@ -353,12 +353,12 @@
# for self.window(for pixmap) and has a side effect of altering
# figure width,height (via configure-event?)
gtk.DrawingArea.realize(self)
-
+
width, height = self.get_width_height()
pixmap = gdk.Pixmap (self.window, width, height)
self._renderer.set_pixmap (pixmap)
self._render_figure(pixmap, width, height)
-
+
# jpg colors don't match the display very well, png colors match
# better
pixbuf = gdk.Pixbuf(gdk.COLORSPACE_RGB, 0, 8, width, height)
@@ -382,18 +382,18 @@
raise ValueError("Saving to a Python file-like object is only
supported by PyGTK >= 2.8")
else:
raise ValueError("filename must be a path or a file-like object")
-
+
def get_default_filetype(self):
return 'png'
def flush_events(self):
-gtk.gdk.threads_enter()
+gtk.gdk.threads_enter()
while gtk.events_pending():
gtk.main_iteration(True)
gtk.gdk.flush()
gtk.gdk.threads_leave()
-
-
+
+
class FigureManagerGTK(FigureManagerBase):
"""
Public attributes
@@ -410,7 +410,7 @@
self.window = gtk.Window()
self.window.set_title("Figure %d" % num)
-
+
self.vbox = gtk.VBox()
self.window.add(self.vbox)
self.vbox.show()
@@ -462,7 +462,7 @@
def show(self):
# show the figure window
self.window.show()
-
+
def full_screen_toggle (self):
self._full_screen_flag = not self._full_screen_flag
if self._full_screen_flag:
@@ -742,8 +742,8 @@
self.fileselect = FileChooserDialog(
title='Save the figure',
parent=self.win,
-formats=self.canvas.get_supported_filetypes(),
-default_type=self.canvas.get_default_filetype())
+filetypes=self.canvas.get_supported_filetypes(),
+default_filetype=self.canvas.get_default_filetype())
else:
self._create_toolitems_2_2()
self.update = self._update_2_2
@@ -912,53 +912,32 @@
self._ind = ind
self._active = [ self._axes[i] for i in self._ind ]
-def panx(self, button, arg):
-"""arg is either user callback data or a scroll event
-"""
-try:
-if arg.direction == gdk.SCROLL_UP: direction=1
-else: direction=-1
-except AttributeError:
-direction = arg
+def panx(self, button, direction):
+'panx in direction'
for a in self._active:
-a.panx(direction)
+a.xaxis.pan(direction)
self.canvas.draw()
return True
-def pany(self, button, arg):
-try:
-if arg.direction == gdk.SCROLL_UP: direction=1
-else: direction=-1
-except AttributeError:
-direction = arg
-
+def pany(self, button, direction):
+'pany in direction'
for a in self._active:
-a.pany(direction)
+a.yaxis.pan(direction)
self.canvas.draw()
return True
-def zoomx(self, button, arg):
-
SF.net SVN: matplotlib: [5396] branches/v0_91_maint/lib/matplotlib/backends
Revision: 5396
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5396&view=rev
Author: jdh2358
Date: 2008-06-05 07:37:03 -0700 (Thu, 05 Jun 2008)
Log Message:
---
fixed classic toolbar bugs
Modified Paths:
--
branches/v0_91_maint/lib/matplotlib/backends/backend_gtk.py
branches/v0_91_maint/lib/matplotlib/backends/backend_tkagg.py
Modified: branches/v0_91_maint/lib/matplotlib/backends/backend_gtk.py
===
--- branches/v0_91_maint/lib/matplotlib/backends/backend_gtk.py 2008-06-05
14:18:31 UTC (rev 5395)
+++ branches/v0_91_maint/lib/matplotlib/backends/backend_gtk.py 2008-06-05
14:37:03 UTC (rev 5396)
@@ -353,12 +353,12 @@
# for self.window(for pixmap) and has a side effect of altering
# figure width,height (via configure-event?)
gtk.DrawingArea.realize(self)
-
+
width, height = self.get_width_height()
pixmap = gdk.Pixmap (self.window, width, height)
self._renderer.set_pixmap (pixmap)
self._render_figure(pixmap, width, height)
-
+
# jpg colors don't match the display very well, png colors match
# better
pixbuf = gdk.Pixbuf(gdk.COLORSPACE_RGB, 0, 8, width, height)
@@ -382,11 +382,11 @@
raise ValueError("Saving to a Python file-like object is only
supported by PyGTK >= 2.8")
else:
raise ValueError("filename must be a path or a file-like object")
-
+
def get_default_filetype(self):
return 'png'
-
+
class FigureManagerGTK(FigureManagerBase):
"""
Public attributes
@@ -403,7 +403,7 @@
self.window = gtk.Window()
self.window.set_title("Figure %d" % num)
-
+
self.vbox = gtk.VBox()
self.window.add(self.vbox)
self.vbox.show()
@@ -455,7 +455,7 @@
def show(self):
# show the figure window
self.window.show()
-
+
def full_screen_toggle (self):
self._full_screen_flag = not self._full_screen_flag
if self._full_screen_flag:
@@ -735,8 +735,8 @@
self.fileselect = FileChooserDialog(
title='Save the figure',
parent=self.win,
-formats=self.canvas.get_supported_filetypes(),
-default_type=self.canvas.get_default_filetype())
+filetypes=self.canvas.get_supported_filetypes(),
+default_filetype=self.canvas.get_default_filetype())
else:
self._create_toolitems_2_2()
self.update = self._update_2_2
@@ -905,53 +905,32 @@
self._ind = ind
self._active = [ self._axes[i] for i in self._ind ]
-def panx(self, button, arg):
-"""arg is either user callback data or a scroll event
-"""
-try:
-if arg.direction == gdk.SCROLL_UP: direction=1
-else: direction=-1
-except AttributeError:
-direction = arg
+def panx(self, button, direction):
+'panx in direction'
for a in self._active:
-a.panx(direction)
+a.xaxis.pan(direction)
self.canvas.draw()
return True
-def pany(self, button, arg):
-try:
-if arg.direction == gdk.SCROLL_UP: direction=1
-else: direction=-1
-except AttributeError:
-direction = arg
-
+def pany(self, button, direction):
+'pany in direction'
for a in self._active:
-a.pany(direction)
+a.yaxis.pan(direction)
self.canvas.draw()
return True
-def zoomx(self, button, arg):
-try:
-if arg.direction == gdk.SCROLL_UP: direction=1
-else: direction=-1
-except AttributeError:
-direction = arg
-
+def zoomx(self, button, direction):
+'zoomx in direction'
for a in self._active:
-a.zoomx(direction)
+a.xaxis.zoom(direction)
self.canvas.draw()
return True
-def zoomy(self, button, arg):
-try:
-if arg.direction == gdk.SCROLL_UP: direction=1
-else: direction=-1
-except AttributeError:
-direction = arg
-
+def zoomy(self, button, direction):
+'zoomy in direction'
for a in self._active:
-a.zoomy(direction)
+a.yaxis.zoom(direction)
self.canvas.draw()
return True
@@ -964,6 +943,7 @@
except Exception, e:
error_msg_gtk(str(e), parent=self)
+
if gtk.pygtk_version >= (2,4,0):
class FileChooserDialog(gtk.FileChooserDialog):
"""GTK+ 2.4 file selector which remembers the last file/directory
@@ -1036,7 +1016,7 @@
break
filename = self.get_filename()
break
-
+
self.hide()
SF.net SVN: matplotlib: [5397] trunk/matplotlib
Revision: 5397 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5397&view=rev Author: jdh2358 Date: 2008-06-05 07:44:07 -0700 (Thu, 05 Jun 2008) Log Message: --- getting classic toolbar in sync on branch and trunk for svnmerge Modified Paths: -- trunk/matplotlib/lib/matplotlib/backends/backend_gtk.py Property Changed: trunk/matplotlib/ Property changes on: trunk/matplotlib ___ Name: svnmerge-integrated - /branches/v0_91_maint:1-5385 + /branches/v0_91_maint:1-5396 Modified: trunk/matplotlib/lib/matplotlib/backends/backend_gtk.py === --- trunk/matplotlib/lib/matplotlib/backends/backend_gtk.py 2008-06-05 14:37:03 UTC (rev 5396) +++ trunk/matplotlib/lib/matplotlib/backends/backend_gtk.py 2008-06-05 14:44:07 UTC (rev 5397) @@ -386,6 +386,7 @@ def get_default_filetype(self): return 'png' + def flush_events(self): gtk.gdk.threads_enter() while gtk.events_pending(): @@ -393,7 +394,6 @@ gtk.gdk.flush() gtk.gdk.threads_leave() - class FigureManagerGTK(FigureManagerBase): """ Public attributes @@ -950,6 +950,7 @@ except Exception, e: error_msg_gtk(str(e), parent=self) + if gtk.pygtk_version >= (2,4,0): class FileChooserDialog(gtk.FileChooserDialog): """GTK+ 2.4 file selector which remembers the last file/directory This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php ___ Matplotlib-checkins mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
SF.net SVN: matplotlib: [5398] trunk/matplotlib/examples/tests/ backend_driver.py
Revision: 5398 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5398&view=rev Author: jdh2358 Date: 2008-06-05 07:47:50 -0700 (Thu, 05 Jun 2008) Log Message: --- updated backend driver to point to the right figtitle demo Modified Paths: -- trunk/matplotlib/examples/tests/backend_driver.py Modified: trunk/matplotlib/examples/tests/backend_driver.py === --- trunk/matplotlib/examples/tests/backend_driver.py 2008-06-05 14:44:07 UTC (rev 5397) +++ trunk/matplotlib/examples/tests/backend_driver.py 2008-06-05 14:47:50 UTC (rev 5398) @@ -48,7 +48,7 @@ 'errorbar_limits.py', 'figimage_demo.py', 'figlegend_demo.py', -'figtext.py', +'figure_title.py', 'fill_demo.py', 'finance_demo.py', 'fonts_demo_kw.py', This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php ___ Matplotlib-checkins mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
SF.net SVN: matplotlib: [5399] trunk/matplotlib/lib/matplotlib
Revision: 5399
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5399&view=rev
Author: jdh2358
Date: 2008-06-05 08:05:47 -0700 (Thu, 05 Jun 2008)
Log Message:
---
tried to fix some api table formatting problems but these apparently were not
the ones triggering the sphinx doc warnings. we need to figure out a way to
make sphinx generate some context in its api warnings since the line numbers
are not helpful
Modified Paths:
--
trunk/matplotlib/lib/matplotlib/axes.py
trunk/matplotlib/lib/matplotlib/text.py
Modified: trunk/matplotlib/lib/matplotlib/axes.py
===
--- trunk/matplotlib/lib/matplotlib/axes.py 2008-06-05 14:47:50 UTC (rev
5398)
+++ trunk/matplotlib/lib/matplotlib/axes.py 2008-06-05 15:05:47 UTC (rev
5399)
@@ -748,6 +748,8 @@
which:
==
+valuedescription
+==
'active' to change the first
'original' to change the second
'both' to change both
@@ -914,6 +916,8 @@
aspect:
+ value description
+
'auto' automatic; fill position rectangle with data
'normal' same as 'auto'; deprecated
'equal'same scaling from data to plot units for x and y
@@ -925,6 +929,8 @@
adjustable:
+ value description
+
'box' change physical size of axes
'datalim' change xlim or ylim
@@ -932,6 +938,8 @@
anchor:
=
+ value description
+ =
'C'centered
'SW' lower left corner
'S'middle of bottom edge
@@ -971,7 +979,9 @@
"""
anchor:
-
+ =
+ value description
+ =
'C'Center
'SW' bottom left
'S'bottom
@@ -981,7 +991,7 @@
'N'top
'NW' top left
'W'left
-
+ =
"""
if anchor in mtransforms.Bbox.coefs.keys() or len(anchor) == 2:
Modified: trunk/matplotlib/lib/matplotlib/text.py
===
--- trunk/matplotlib/lib/matplotlib/text.py 2008-06-05 14:47:50 UTC (rev
5398)
+++ trunk/matplotlib/lib/matplotlib/text.py 2008-06-05 15:05:47 UTC (rev
5399)
@@ -1024,7 +1024,7 @@
in cartesian plots. Note that if you
are using a polar axes, you do not need
to specify polar for the coordinate
-system since that is the native"data" coordinate
+system since that is the native "data" coordinate
system.
= ===
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
SF.net SVN: matplotlib: [5400] trunk/matplotlib/doc/_static/transforms.png
Revision: 5400 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5400&view=rev Author: mdboom Date: 2008-06-05 08:08:28 -0700 (Thu, 05 Jun 2008) Log Message: --- Forgot to commit this file Added Paths: --- trunk/matplotlib/doc/_static/transforms.png Added: trunk/matplotlib/doc/_static/transforms.png === (Binary files differ) Property changes on: trunk/matplotlib/doc/_static/transforms.png ___ Name: svn:mime-type + application/octet-stream This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php ___ Matplotlib-checkins mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
SF.net SVN: matplotlib: [5401] trunk/matplotlib
Revision: 5401 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5401&view=rev Author: jdh2358 Date: 2008-06-05 09:17:57 -0700 (Thu, 05 Jun 2008) Log Message: --- fixed collection demo to remove deprecated dpi Modified Paths: -- trunk/matplotlib/doc/users/navigation_toolbar.rst trunk/matplotlib/examples/api/collections_demo.py Added Paths: --- trunk/matplotlib/doc/_static/toolbar.png Added: trunk/matplotlib/doc/_static/toolbar.png === (Binary files differ) Property changes on: trunk/matplotlib/doc/_static/toolbar.png ___ Name: svn:mime-type + application/octet-stream Modified: trunk/matplotlib/doc/users/navigation_toolbar.rst === --- trunk/matplotlib/doc/users/navigation_toolbar.rst 2008-06-05 15:08:28 UTC (rev 5400) +++ trunk/matplotlib/doc/users/navigation_toolbar.rst 2008-06-05 16:17:57 UTC (rev 5401) @@ -3,6 +3,9 @@ Interactive navigation == +.. image:: ../_static/toolbar.png + :scale: 100 + All figure windows come with a navigation toolbar, which can be used to navigate through the data set. Here is a description of each of the buttons at the bottom of the toolbar Modified: trunk/matplotlib/examples/api/collections_demo.py === --- trunk/matplotlib/examples/api/collections_demo.py 2008-06-05 15:08:28 UTC (rev 5400) +++ trunk/matplotlib/examples/api/collections_demo.py 2008-06-05 16:17:57 UTC (rev 5401) @@ -86,7 +86,7 @@ a = fig.add_subplot(2,2,3) -col = collections.RegularPolyCollection(fig.dpi, 7, +col = collections.RegularPolyCollection(7, sizes = N.fabs(xx)*10.0, offsets=xyo, transOffset=a.transData) trans = transforms.Affine2D().scale(fig.dpi/72.0) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php ___ Matplotlib-checkins mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
SF.net SVN: matplotlib: [5402] trunk/matplotlib
Revision: 5402
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5402&view=rev
Author: mdboom
Date: 2008-06-05 10:06:16 -0700 (Thu, 05 Jun 2008)
Log Message:
---
Fix one-pixel space between images and axes border.
Modified Paths:
--
trunk/matplotlib/CHANGELOG
trunk/matplotlib/lib/matplotlib/image.py
Modified: trunk/matplotlib/CHANGELOG
===
--- trunk/matplotlib/CHANGELOG 2008-06-05 16:17:57 UTC (rev 5401)
+++ trunk/matplotlib/CHANGELOG 2008-06-05 17:06:16 UTC (rev 5402)
@@ -1,3 +1,6 @@
+2008-06-05 Fix image drawing so there is no extra space to the right
+ or bottom - MGD
+
2006-06-04 Added a figure title command subtitle as a Figure method
and pyplot command -- see examples/figure_title.py - JDH
Modified: trunk/matplotlib/lib/matplotlib/image.py
===
--- trunk/matplotlib/lib/matplotlib/image.py2008-06-05 16:17:57 UTC (rev
5401)
+++ trunk/matplotlib/lib/matplotlib/image.py2008-06-05 17:06:16 UTC (rev
5402)
@@ -205,7 +205,9 @@
tx = (xmin-self.axes.viewLim.x0)/dxintv * numcols
ty = (ymin-self.axes.viewLim.y0)/dyintv * numrows
-l, b, widthDisplay, heightDisplay = self.axes.bbox.bounds
+l, b, r, t = self.axes.bbox.extents
+widthDisplay = (round(r) + 0.5) - (round(l) - 0.5)
+heightDisplay = (round(t) + 0.5) - (round(b) - 0.5)
widthDisplay *= magnification
heightDisplay *= magnification
im.apply_translation(tx, ty)
@@ -226,7 +228,7 @@
warnings.warn("Images are not supported on non-linear axes.")
im = self.make_image(renderer.get_image_magnification())
l, b, widthDisplay, heightDisplay = self.axes.bbox.bounds
-renderer.draw_image(l, b, im, self.axes.bbox.frozen(),
+renderer.draw_image(round(l), round(b), im, self.axes.bbox.frozen(),
*self.get_transformed_clip_path_and_affine())
def contains(self, mouseevent):
@@ -378,7 +380,9 @@
raise RuntimeError('You must first set the image array')
x0, y0, v_width, v_height = self.axes.viewLim.bounds
-l, b, width, height = self.axes.bbox.bounds
+l, b, r, t = self.axes.bbox.extents
+width = (round(r) + 0.5) - (round(l) - 0.5)
+height = (round(t) + 0.5) - (round(b) - 0.5)
width *= magnification
height *= magnification
im = _image.pcolor(self._Ax, self._Ay, self._A,
@@ -487,8 +491,11 @@
fc = self.axes.get_frame().get_facecolor()
bg = mcolors.colorConverter.to_rgba(fc, 0)
bg = (np.array(bg)*255).astype(np.uint8)
-width = self.axes.bbox.width * magnification
-height = self.axes.bbox.height * magnification
+l, b, r, t = self.axes.bbox.extents
+width = (round(r) + 0.5) - (round(l) - 0.5)
+height = (round(t) + 0.5) - (round(b) - 0.5)
+width = width * magnification
+height = height * magnification
if self.check_update('array'):
A = self.to_rgba(self._A, alpha=self._alpha, bytes=True)
self._rgbacache = A
@@ -508,8 +515,8 @@
def draw(self, renderer, *args, **kwargs):
if not self.get_visible(): return
im = self.make_image(renderer.get_image_magnification())
-renderer.draw_image(self.axes.bbox.xmin,
-self.axes.bbox.ymin,
+renderer.draw_image(round(self.axes.bbox.xmin),
+round(self.axes.bbox.ymin),
im,
self.axes.bbox.frozen(),
*self.get_transformed_clip_path_and_affine())
@@ -638,7 +645,7 @@
def draw(self, renderer, *args, **kwargs):
if not self.get_visible(): return
im = self.make_image()
-renderer.draw_image(self.ox, self.oy, im, self.figure.bbox,
+renderer.draw_image(round(self.ox), round(self.oy), im,
self.figure.bbox,
*self.get_transformed_clip_path_and_affine())
def write_png(self, fname):
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
SF.net SVN: matplotlib: [5403] trunk/matplotlib
Revision: 5403 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5403&view=rev Author: mdboom Date: 2008-06-05 10:09:04 -0700 (Thu, 05 Jun 2008) Log Message: --- Fix dpi-changing-related bugs in Axes.scatter() Modified Paths: -- trunk/matplotlib/CHANGELOG trunk/matplotlib/examples/api/collections_demo.py trunk/matplotlib/lib/matplotlib/axes.py trunk/matplotlib/lib/matplotlib/collections.py Modified: trunk/matplotlib/CHANGELOG === --- trunk/matplotlib/CHANGELOG 2008-06-05 17:06:16 UTC (rev 5402) +++ trunk/matplotlib/CHANGELOG 2008-06-05 17:09:04 UTC (rev 5403) @@ -1,3 +1,6 @@ +2008-06-05 Fix some dpi-changing-related problems with PolyCollection, + as called by Axes.scatter() - MGD + 2008-06-05 Fix image drawing so there is no extra space to the right or bottom - MGD Modified: trunk/matplotlib/examples/api/collections_demo.py === --- trunk/matplotlib/examples/api/collections_demo.py 2008-06-05 17:06:16 UTC (rev 5402) +++ trunk/matplotlib/examples/api/collections_demo.py 2008-06-05 17:09:04 UTC (rev 5403) @@ -33,8 +33,9 @@ spiral = zip(xx,yy) # Make some offsets -xo = N.random.randn(npts) -yo = N.random.randn(npts) +rs = N.random.RandomState([12345678]) +xo = rs.randn(npts) +yo = rs.randn(npts) xyo = zip(xo, yo) # Make a list of colors cycling through the rgbcmyk series. @@ -45,7 +46,7 @@ a = fig.add_subplot(2,2,1) col = collections.LineCollection([spiral], offsets=xyo, transOffset=a.transData) -trans = transforms.Affine2D().scale(fig.dpi/72.0) +trans = fig.dpi_scale_trans + transforms.Affine2D().scale(1.0/72.0) col.set_transform(trans) # the points to pixels transform # Note: the first argument to the collection initializer # must be a list of sequences of x,y tuples; we have only @@ -112,7 +113,7 @@ xx = (0.2 + (ym-yy)/ym)**2 * N.cos(yy-0.4) * 0.5 segs = [] for i in range(ncurves): -xxx = xx + 0.02*N.random.randn(nverts) +xxx = xx + 0.02*rs.randn(nverts) curve = zip(xxx, yy*100) segs.append(curve) Modified: trunk/matplotlib/lib/matplotlib/axes.py === --- trunk/matplotlib/lib/matplotlib/axes.py 2008-06-05 17:06:16 UTC (rev 5402) +++ trunk/matplotlib/lib/matplotlib/axes.py 2008-06-05 17:09:04 UTC (rev 5403) @@ -4603,15 +4603,8 @@ rescale = np.sqrt(max(verts[:,0]**2+verts[:,1]**2)) verts /= rescale -scales = np.asarray(scales) -scales = np.sqrt(scales * self.figure.dpi / 72.) -if len(scales)==1: -verts = [scales[0]*verts] -else: -# todo -- make this nx friendly -verts = [verts*s for s in scales] collection = mcoll.PolyCollection( -verts, +verts, scales, facecolors = colors, edgecolors = edgecolors, linewidths = linewidths, Modified: trunk/matplotlib/lib/matplotlib/collections.py === --- trunk/matplotlib/lib/matplotlib/collections.py 2008-06-05 17:06:16 UTC (rev 5402) +++ trunk/matplotlib/lib/matplotlib/collections.py 2008-06-05 17:09:04 UTC (rev 5403) @@ -492,15 +492,19 @@ renderer.close_group(self.__class__.__name__) class PolyCollection(Collection): -def __init__(self, verts, **kwargs): +def __init__(self, verts, sizes = (1, ), **kwargs): """ verts is a sequence of ( verts0, verts1, ...) where verts_i is a sequence of xy tuples of vertices, or an equivalent numpy array of shape (nv,2). +sizes gives the area of the circle circumscribing the +polygon in points^2 + %(Collection)s """ Collection.__init__(self,**kwargs) +self._sizes = sizes self.set_verts(verts) __init__.__doc__ = cbook.dedent(__init__.__doc__) % artist.kwdocd @@ -511,6 +515,15 @@ def get_paths(self): return self._paths +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)) +for x in self._sizes] +return Collection.draw(self, renderer) + class BrokenBarHCollection(PolyCollection): """ A colleciton of horizontal bars spanning yrange with a sequence of This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell
SF.net SVN: matplotlib: [5404] trunk/matplotlib/doc
Revision: 5404
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5404&view=rev
Author: mdboom
Date: 2008-06-05 10:33:24 -0700 (Thu, 05 Jun 2008)
Log Message:
---
Add some CSS so that there are lines above classes and methods in the
auto-generated docs.
Modified Paths:
--
trunk/matplotlib/doc/conf.py
Added Paths:
---
trunk/matplotlib/doc/_static/matplotlib.css
Added: trunk/matplotlib/doc/_static/matplotlib.css
===
--- trunk/matplotlib/doc/_static/matplotlib.css (rev 0)
+++ trunk/matplotlib/doc/_static/matplotlib.css 2008-06-05 17:33:24 UTC (rev
5404)
@@ -0,0 +1,9 @@
[EMAIL PROTECTED] "default.css";
+
+dl.class, dl.function {
+border-top: 2px solid #888;
+}
+
+dl.method, dl.attribute {
+border-top: 1px solid #aaa;
+}
\ No newline at end of file
Modified: trunk/matplotlib/doc/conf.py
===
--- trunk/matplotlib/doc/conf.py2008-06-05 17:09:04 UTC (rev 5403)
+++ trunk/matplotlib/doc/conf.py2008-06-05 17:33:24 UTC (rev 5404)
@@ -80,7 +80,7 @@
# The style sheet to use for HTML and HTML Help pages. A file of that name
# must exist either in Sphinx' static/ path, or in one of the custom paths
# given in html_static_path.
-html_style = 'default.css'
+html_style = 'matplotlib.css'
# The name for this set of Sphinx documents. If None, it defaults to
# " v documentation".
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
SF.net SVN: matplotlib: [5405] trunk/matplotlib/lib/matplotlib/patches.py
Revision: 5405 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5405&view=rev Author: mdboom Date: 2008-06-05 12:14:53 -0700 (Thu, 05 Jun 2008) Log Message: --- Close polygons. Modified Paths: -- trunk/matplotlib/lib/matplotlib/patches.py Modified: trunk/matplotlib/lib/matplotlib/patches.py === --- trunk/matplotlib/lib/matplotlib/patches.py 2008-06-05 17:33:24 UTC (rev 5404) +++ trunk/matplotlib/lib/matplotlib/patches.py 2008-06-05 19:14:53 UTC (rev 5405) @@ -540,6 +540,9 @@ See Patch documentation for additional kwargs """ Patch.__init__(self, **kwargs) +xy = np.asarray(xy, np.float_) +if len(xy) and xy[0] != xy[-1]: +xy = np.concatenate([xy, [xy[0]]]) self._path = Path(xy) __init__.__doc__ = cbook.dedent(__init__.__doc__) % artist.kwdocd This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php ___ Matplotlib-checkins mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
SF.net SVN: matplotlib: [5406] trunk/matplotlib/doc/_static/matplotlib.css
Revision: 5406
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5406&view=rev
Author: mdboom
Date: 2008-06-05 12:34:57 -0700 (Thu, 05 Jun 2008)
Log Message:
---
Add newline to end of file.
Modified Paths:
--
trunk/matplotlib/doc/_static/matplotlib.css
Modified: trunk/matplotlib/doc/_static/matplotlib.css
===
--- trunk/matplotlib/doc/_static/matplotlib.css 2008-06-05 19:14:53 UTC (rev
5405)
+++ trunk/matplotlib/doc/_static/matplotlib.css 2008-06-05 19:34:57 UTC (rev
5406)
@@ -6,4 +6,4 @@
dl.method, dl.attribute {
border-top: 1px solid #aaa;
-}
\ No newline at end of file
+}
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
SF.net SVN: matplotlib: [5407] trunk/matplotlib/examples/api/histogram_demo .py
Revision: 5407
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5407&view=rev
Author: jdh2358
Date: 2008-06-05 15:23:50 -0700 (Thu, 05 Jun 2008)
Log Message:
---
added api histogram demo which comments on the new bins return value
Added Paths:
---
trunk/matplotlib/examples/api/histogram_demo.py
Added: trunk/matplotlib/examples/api/histogram_demo.py
===
--- trunk/matplotlib/examples/api/histogram_demo.py
(rev 0)
+++ trunk/matplotlib/examples/api/histogram_demo.py 2008-06-05 22:23:50 UTC
(rev 5407)
@@ -0,0 +1,35 @@
+"""
+Make a histogram of normally distributed random numbers and plot the
+analytic PDF over it
+"""
+import numpy as np
+import matplotlib.pyplot as plt
+import matplotlib.mlab as mlab
+
+mu, sigma = 100, 15
+x = mu + sigma * np.random.randn(1)
+
+fig = plt.figure()
+ax = fig.add_subplot(111)
+
+# the histogram of the data
+n, bins, patches = ax.hist(x, 50, normed=1, facecolor='green', alpha=0.75)
+
+# hist uses np.histogram under the hood to create 'n' and 'bins'.
+# np.histogram returns the bin edges, so there will be 50 probability
+# density values in n, 51 bin edges in bins and 50 patches. To get
+# everything lined up, we'll compute the bin centers
+bincenters = 0.5*(bins[1:]+bins[:-1])
+# add a 'best fit' line for the normal PDF
+y = mlab.normpdf( bincenters, mu, sigma)
+l = ax.plot(bincenters, y, 'r--', linewidth=1)
+
+ax.set_xlabel('Smarts')
+ax.set_ylabel('Probability')
+#ax.set_title(r'$\mathrm{Histogram\ of\ IQ:}\ \mu=100,\ \sigma=15$')
+ax.set_xlim(40, 160)
+ax.set_ylim(0, 0.03)
+ax.grid(True)
+
+#fig.savefig('histogram_demo',dpi=72)
+plt.show()
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
SF.net SVN: matplotlib: [5408] trunk/matplotlib/doc/devel
Revision: 5408 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5408&view=rev Author: jdh2358 Date: 2008-06-05 20:45:57 -0700 (Thu, 05 Jun 2008) Log Message: --- added draft outline Modified Paths: -- trunk/matplotlib/doc/devel/index.rst Added Paths: --- trunk/matplotlib/doc/devel/outline.rst Modified: trunk/matplotlib/doc/devel/index.rst === --- trunk/matplotlib/doc/devel/index.rst2008-06-05 22:23:50 UTC (rev 5407) +++ trunk/matplotlib/doc/devel/index.rst2008-06-06 03:45:57 UTC (rev 5408) @@ -13,4 +13,4 @@ documenting_mpl.rst transformations.rst add_new_projection.rst - + outline.rst Added: trunk/matplotlib/doc/devel/outline.rst === --- trunk/matplotlib/doc/devel/outline.rst (rev 0) +++ trunk/matplotlib/doc/devel/outline.rst 2008-06-06 03:45:57 UTC (rev 5408) @@ -0,0 +1,99 @@ +.. _outline: + + +Docs outline + + +Proposed chapters for the docs, who has responsibility for them, and +who reviews them. The "unit" doesn't have to be a full chapter +(though in some cases it will be), it may be a chapter or a section in +a chapter. + +=== === === +User's guide unitAuthor Status Reviewer +=== === === +contouring Eric ? no authorPerry ? +quiver plots Eric ? no author? +quadmesh ?no author? +images ?no author? +histograms Manuel ? no authorErik Tollerud ? +bar / errorbar ?no author? +x-y plots?no author? +time series plots?no author? +date plots John has author ? +working with dataJohn has author ? +custom ticking ?no author? +masked data Eric ? no author? +text ?no author? +patches ?no author? +legends ?no author? +animationJohn has author ? +collections ?no author? +mathtext Michael ?submittedJohn +fonts et al Michael ?no author? +pyplot tut John submittedEric ? +usetex Darren ? no author? +configurationDarren ? preliminary ? +colormapping Perry ? no authorEric ? +win32 installCharlie ?no author? +os x install Charlie ?no author? +linux install?no 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 ? no author? +backend - pdfJouni ? no author? +backend - ps Darren ? no 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
