|
From: <jd...@us...> - 2008-07-26 23:26:04
|
Revision: 5895
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5895&view=rev
Author: jdh2358
Date: 2008-07-26 23:26:02 +0000 (Sat, 26 Jul 2008)
Log Message:
-----------
more broken example fixes
Modified Paths:
--------------
trunk/matplotlib/examples/pylab_examples/multi_image.py
trunk/matplotlib/examples/tests/backend_driver.py
Modified: trunk/matplotlib/examples/pylab_examples/multi_image.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/multi_image.py 2008-07-26 23:11:54 UTC (rev 5894)
+++ trunk/matplotlib/examples/pylab_examples/multi_image.py 2008-07-26 23:26:02 UTC (rev 5895)
@@ -50,17 +50,25 @@
# Set the first image as the master, with all the others
# observing it for changes in cmap or norm.
+
+class ImageFollower:
+ 'update image in response to changes in clim or cmap on another image'
+ def __init__(self, follower):
+ self.follower = follower
+ def __call__(self, leader):
+ self.follower.set_cmap(leader.get_cmap())
+ self.follower.set_clim(leader.get_clim())
+
norm = colors.Normalize(vmin=vmin, vmax=vmax)
for i, im in enumerate(images):
im.set_norm(norm)
if i > 0:
- images[0].add_observer(im)
+ images[0].callbacksSM.connect('changed', ImageFollower(im))
# The colorbar is also based on this master image.
fig.colorbar(images[0], cax, orientation='horizontal')
# We need the following only if we want to run this
-# script interactively and be able to change the colormap.
sci(images[0])
Modified: trunk/matplotlib/examples/tests/backend_driver.py
===================================================================
--- trunk/matplotlib/examples/tests/backend_driver.py 2008-07-26 23:11:54 UTC (rev 5894)
+++ trunk/matplotlib/examples/tests/backend_driver.py 2008-07-26 23:26:02 UTC (rev 5895)
@@ -43,6 +43,7 @@
'contour_demo.py',
'contour_label_demo.py',
'contourf_demo.py',
+ 'geo_demo.py',
'griddata_demo.py',
'csd_demo.py',
'custom_ticker1.py',
@@ -80,6 +81,7 @@
'mathtext_demo.py',
'mri_with_eeg.py',
'multiple_figs_demo.py',
+ 'multi_image.py',
'nan_test.py',
'pcolor_demo.py',
'pcolor_demo2.py',
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|