I've realized that using the ParasiteAxes from the mpl_toolkits should do
exactly what I'm asking. However, I am having a problem with callbacks when
the x and y limits change (try resizing the window). The following script
shows that the callback for the second set of axes is not carried out. Is
this a bug, or a limitation? Or something I'm doing wrong?

Thanks!

Thomas

---

import matplotlib.pyplot as mpl
import numpy as np
import mpl_toolkits.axes_grid.parasite_axes as mpl_toolkit

def check_callback(ax):
    print "callback for ",ax.name
    
array = np.random.random((100,100))

fig = mpl.figure()
ax = mpl_toolkit.SubplotHost(fig,1,1,1,adjustable='datalim')

ax.name = "first axis"
ax.callbacks.connect('xlim_changed',check_callback)
ax.callbacks.connect('xlim_changed',check_callback)

ax2 = ax.twin()
ax2.name = "second axis"
ax2.callbacks.connect('ylim_changed',check_callback)
ax2.callbacks.connect('ylim_changed',check_callback)

fig.add_axes(ax)

ax.imshow(array,interpolation='nearest')

fig.canvas.draw()

---


-- 
View this message in context: 
http://www.nabble.com/Enforcing-common-view-limits-tp23334325p23348018.html
Sent from the matplotlib - users mailing list archive at Nabble.com.


------------------------------------------------------------------------------
Register Now & Save for Velocity, the Web Performance & Operations 
Conference from O'Reilly Media. Velocity features a full day of 
expert-led, hands-on workshops and two days of sessions from industry 
leaders in dedicated Performance & Operations tracks. Use code vel09scf 
and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to