SF.net SVN: matplotlib:[8568] branches/v1_0_maint/lib/matplotlib/backends/ backend_gtk.py

2010-07-23 Thread mdboom
Revision: 8568
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8568&view=rev
Author:   mdboom
Date: 2010-07-23 13:17:15 + (Fri, 23 Jul 2010)

Log Message:
---
Prevent traceback when window icon can not be loaded in Gtk backend.

Modified Paths:
--
branches/v1_0_maint/lib/matplotlib/backends/backend_gtk.py

Modified: branches/v1_0_maint/lib/matplotlib/backends/backend_gtk.py
===
--- branches/v1_0_maint/lib/matplotlib/backends/backend_gtk.py  2010-07-20 
18:29:08 UTC (rev 8567)
+++ branches/v1_0_maint/lib/matplotlib/backends/backend_gtk.py  2010-07-23 
13:17:15 UTC (rev 8568)
@@ -33,6 +33,7 @@
 
 from matplotlib import lines
 from matplotlib import cbook
+from matplotlib import verbose
 
 backend_version = "%d.%d.%d" % gtk.pygtk_version
 
@@ -1224,7 +1225,6 @@
 window_icon = None
 verbose.report('Could not load matplotlib icon: %s' % sys.exc_info()[1])
 
-
 def error_msg_gtk(msg, parent=None):
 if parent is not None: # find the toplevel gtk.Window
 parent = parent.get_toplevel()


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

--
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins


SF.net SVN: matplotlib:[8569] trunk/matplotlib

2010-07-23 Thread mdboom
Revision: 8569
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8569&view=rev
Author:   mdboom
Date: 2010-07-23 13:18:47 + (Fri, 23 Jul 2010)

Log Message:
---
Merged revisions 8568 via svnmerge from 
https://matplotlib.svn.sf.net/svnroot/matplotlib/branches/v1_0_maint


  r8568 | mdboom | 2010-07-23 09:17:15 -0400 (Fri, 23 Jul 2010) | 2 lines
  
  Prevent traceback when window icon can not be loaded in Gtk backend.


Modified Paths:
--
trunk/matplotlib/lib/matplotlib/backends/backend_gtk.py

Property Changed:

trunk/matplotlib/


Property changes on: trunk/matplotlib
___
Modified: svnmerge-integrated
   - /branches/mathtex:1-7263 /branches/v0_91_maint:1-6428 
/branches/v0_98_5_maint:1-7253 /branches/v1_0_maint:1-8566 
/trunk/matplotlib:1-7315
   + /branches/mathtex:1-7263 /branches/v0_91_maint:1-6428 
/branches/v0_98_5_maint:1-7253 /branches/v1_0_maint:1-8568 
/trunk/matplotlib:1-7315

Modified: trunk/matplotlib/lib/matplotlib/backends/backend_gtk.py
===
--- trunk/matplotlib/lib/matplotlib/backends/backend_gtk.py 2010-07-23 
13:17:15 UTC (rev 8568)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_gtk.py 2010-07-23 
13:18:47 UTC (rev 8569)
@@ -33,6 +33,7 @@
 
 from matplotlib import lines
 from matplotlib import cbook
+from matplotlib import verbose
 
 backend_version = "%d.%d.%d" % gtk.pygtk_version
 
@@ -1224,7 +1225,6 @@
 window_icon = None
 verbose.report('Could not load matplotlib icon: %s' % sys.exc_info()[1])
 
-
 def error_msg_gtk(msg, parent=None):
 if parent is not None: # find the toplevel gtk.Window
 parent = parent.get_toplevel()


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

--
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins


SF.net SVN: matplotlib:[8570] branches/v1_0_maint/lib/matplotlib

2010-07-23 Thread mdboom
Revision: 8570
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8570&view=rev
Author:   mdboom
Date: 2010-07-23 16:45:24 + (Fri, 23 Jul 2010)

Log Message:
---
Fix image clipping to a path and add a test.

Modified Paths:
--
branches/v1_0_maint/lib/matplotlib/axes.py
branches/v1_0_maint/lib/matplotlib/image.py
branches/v1_0_maint/lib/matplotlib/tests/test_image.py

Added Paths:
---

branches/v1_0_maint/lib/matplotlib/tests/baseline_images/test_image/image_clip.pdf

branches/v1_0_maint/lib/matplotlib/tests/baseline_images/test_image/image_clip.png

branches/v1_0_maint/lib/matplotlib/tests/baseline_images/test_image/image_clip.svg

Modified: branches/v1_0_maint/lib/matplotlib/axes.py
===
--- branches/v1_0_maint/lib/matplotlib/axes.py  2010-07-23 13:18:47 UTC (rev 
8569)
+++ branches/v1_0_maint/lib/matplotlib/axes.py  2010-07-23 16:45:24 UTC (rev 
8570)
@@ -6732,7 +6732,7 @@
 im.set_data(X)
 im.set_alpha(alpha)
 self._set_artist_props(im)
-if not im.get_clip_on():
+if im.get_clip_path() is None:
 # image does not already have clipping set, clip to axes patch
 im.set_clip_path(self.patch)
 #if norm is None and shape is None:

Modified: branches/v1_0_maint/lib/matplotlib/image.py
===
--- branches/v1_0_maint/lib/matplotlib/image.py 2010-07-23 13:18:47 UTC (rev 
8569)
+++ branches/v1_0_maint/lib/matplotlib/image.py 2010-07-23 16:45:24 UTC (rev 
8570)
@@ -338,6 +338,7 @@
 gc = renderer.new_gc()
 gc.set_clip_rectangle(self.axes.bbox.frozen())
 gc.set_clip_path(self.get_clip_path())
+print self.get_clip_path()
 
 if self._check_unsampled_image(renderer):
 self._draw_unsampled_image(renderer, gc)
@@ -541,7 +542,9 @@
 **kwargs
 )
 
+print "__init__", self.get_clip_on()
 
+
 def make_image(self, magnification=1.0):
 if self._A is None:
 raise RuntimeError('You must first set the image array or the 
image attribute')

Added: 
branches/v1_0_maint/lib/matplotlib/tests/baseline_images/test_image/image_clip.pdf
===
(Binary files differ)


Property changes on: 
branches/v1_0_maint/lib/matplotlib/tests/baseline_images/test_image/image_clip.pdf
___
Added: svn:mime-type
   + application/octet-stream

Added: 
branches/v1_0_maint/lib/matplotlib/tests/baseline_images/test_image/image_clip.png
===
(Binary files differ)


Property changes on: 
branches/v1_0_maint/lib/matplotlib/tests/baseline_images/test_image/image_clip.png
___
Added: svn:mime-type
   + application/octet-stream

Added: 
branches/v1_0_maint/lib/matplotlib/tests/baseline_images/test_image/image_clip.svg
===
--- 
branches/v1_0_maint/lib/matplotlib/tests/baseline_images/test_image/image_clip.svg
  (rev 0)
+++ 
branches/v1_0_maint/lib/matplotlib/tests/baseline_images/test_image/image_clip.svg
  2010-07-23 16:45:24 UTC (rev 8570)
@@ -0,0 +1,659 @@
+
+http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd";>
+
+http://www.w3.org/2000/svg";
+   xmlns:xlink="http://www.w3.org/1999/xlink";
+   version="1.1"
+   id="svg1">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

Modified: branches/v1_0_maint/lib/matplotlib/tests/test_image.py
===
--- branches/v1_0_maint/lib/matplotlib/tests/test_image.py  2010-07-23 
13:18:47 UTC (rev 8569)
+++ branches/v1_0_maint/lib/matplotlib/tests/test_image.py  2010-07-23 
16:45:24 UTC (rev 8570)
@@ -95,7 +95,20 @@
 
 assert_array_equal(arr_dpi1, arr_dpi100)
 
+...@image_comparison(baseline_images=['image_clip'])
+def test_image_clip():
+from math import pi
 
+fig = plt.figure()
+ax = fig.add_subplot(111, projection='hammer')
+
+d = [[1,2],[3,4]]
+
+ax.imshow(d, extent=(-pi,pi,-pi/2,pi/2))
+
+fig.savefig('image_clip')
+
+
 if __name__=='__main__':
 import nose
 nose.runmodule(argv=['-s','--with-doctest'], exit=False)


This was sent by the 

SF.net SVN: matplotlib:[8571] branches/v1_0_maint/lib/matplotlib/image.py

2010-07-23 Thread mdboom
Revision: 8571
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8571&view=rev
Author:   mdboom
Date: 2010-07-23 16:46:40 + (Fri, 23 Jul 2010)

Log Message:
---
Oops in last commit.

Modified Paths:
--
branches/v1_0_maint/lib/matplotlib/image.py

Modified: branches/v1_0_maint/lib/matplotlib/image.py
===
--- branches/v1_0_maint/lib/matplotlib/image.py 2010-07-23 16:45:24 UTC (rev 
8570)
+++ branches/v1_0_maint/lib/matplotlib/image.py 2010-07-23 16:46:40 UTC (rev 
8571)
@@ -338,7 +338,6 @@
 gc = renderer.new_gc()
 gc.set_clip_rectangle(self.axes.bbox.frozen())
 gc.set_clip_path(self.get_clip_path())
-print self.get_clip_path()
 
 if self._check_unsampled_image(renderer):
 self._draw_unsampled_image(renderer, gc)
@@ -542,9 +541,7 @@
 **kwargs
 )
 
-print "__init__", self.get_clip_on()
 
-
 def make_image(self, magnification=1.0):
 if self._A is None:
 raise RuntimeError('You must first set the image array or the 
image attribute')


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

--
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins


SF.net SVN: matplotlib:[8572] trunk/matplotlib

2010-07-23 Thread mdboom
Revision: 8572
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8572&view=rev
Author:   mdboom
Date: 2010-07-23 16:47:30 + (Fri, 23 Jul 2010)

Log Message:
---
Merged revisions 8570-8571 via svnmerge from 
https://matplotlib.svn.sf.net/svnroot/matplotlib/branches/v1_0_maint


  r8570 | mdboom | 2010-07-23 12:45:24 -0400 (Fri, 23 Jul 2010) | 2 lines
  
  Fix image clipping to a path and add a test.

  r8571 | mdboom | 2010-07-23 12:46:40 -0400 (Fri, 23 Jul 2010) | 2 lines
  
  Oops in last commit.


Modified Paths:
--
trunk/matplotlib/lib/matplotlib/axes.py
trunk/matplotlib/lib/matplotlib/tests/test_image.py

Added Paths:
---

trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_image/image_clip.pdf

trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_image/image_clip.png

trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_image/image_clip.svg

Property Changed:

trunk/matplotlib/


Property changes on: trunk/matplotlib
___
Modified: svnmerge-integrated
   - /branches/mathtex:1-7263 /branches/v0_91_maint:1-6428 
/branches/v0_98_5_maint:1-7253 /branches/v1_0_maint:1-8568 
/trunk/matplotlib:1-7315
   + /branches/mathtex:1-7263 /branches/v0_91_maint:1-6428 
/branches/v0_98_5_maint:1-7253 /branches/v1_0_maint:1-8571 
/trunk/matplotlib:1-7315

Modified: trunk/matplotlib/lib/matplotlib/axes.py
===
--- trunk/matplotlib/lib/matplotlib/axes.py 2010-07-23 16:46:40 UTC (rev 
8571)
+++ trunk/matplotlib/lib/matplotlib/axes.py 2010-07-23 16:47:30 UTC (rev 
8572)
@@ -6732,7 +6732,7 @@
 im.set_data(X)
 im.set_alpha(alpha)
 self._set_artist_props(im)
-if not im.get_clip_on():
+if im.get_clip_path() is None:
 # image does not already have clipping set, clip to axes patch
 im.set_clip_path(self.patch)
 #if norm is None and shape is None:

Copied: 
trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_image/image_clip.pdf 
(from rev 8571, 
branches/v1_0_maint/lib/matplotlib/tests/baseline_images/test_image/image_clip.pdf)
===
(Binary files differ)

Copied: 
trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_image/image_clip.png 
(from rev 8571, 
branches/v1_0_maint/lib/matplotlib/tests/baseline_images/test_image/image_clip.png)
===
(Binary files differ)

Copied: 
trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_image/image_clip.svg 
(from rev 8571, 
branches/v1_0_maint/lib/matplotlib/tests/baseline_images/test_image/image_clip.svg)
===
--- 
trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_image/image_clip.svg 
(rev 0)
+++ 
trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_image/image_clip.svg 
2010-07-23 16:47:30 UTC (rev 8572)
@@ -0,0 +1,659 @@
+
+http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd";>
+
+http://www.w3.org/2000/svg";
+   xmlns:xlink="http://www.w3.org/1999/xlink";
+   version="1.1"
+   id="svg1">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

Modified: trunk/matplotlib/lib/matplotlib/tests/test_image.py
===
--- trunk/matplotlib/lib/matplotlib/tests/test_image.py 2010-07-23 16:46:40 UTC 
(rev 8571)
+++ trunk/matplotlib/lib/matplotlib/tests/test_image.py 2010-07-23 16:47:30 UTC 
(rev 8572)
@@ -95,7 +95,20 @@
 
 assert_array_equal(arr_dpi1, arr_dpi100)
 
+...@image_comparison(baseline_images=['image_clip'])
+def test_image_clip():
+from math import pi
 
+fig = plt.figure()
+ax = fig.add_subplot(111, projection='hammer')
+
+d = [[1,2],[3,4]]
+
+ax.imshow(d, extent=(-pi,pi,-pi/2,pi/2))
+
+fig.savefig('image_clip')
+
+
 if __name__=='__main__':
 import nose
 nose.runmodule(argv=['-s','--with-doctest'], exit=False)


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

--
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-fir