From: Jae-Joon L. <lee...@gm...> - 2010-03-21 21:42:47
|
On Sat, Mar 20, 2010 at 8:40 PM, Eric Firing <ef...@ha...> wrote: > By the way, given that we now have "suplots" in the pyplot namespace, >> can we have sca also? >> > > Done in svn 8205. > Eric, A minor question. I wonder whether an explicit for-loop inside pyplot.sca is necessary? Here is a slight variation w/o a for-loop (well, the for-loop is implicitly done with the "in" operator I guess) that seems to work for me, but I may be missing something. managers = _pylab_helpers.Gcf.get_all_fig_managers() if ax.figure.canvas.manager in managers and \ ax in ax.figure.axes: _pylab_helpers.Gcf.set_active(ax.figure.canvas.manager) ax.figure.sca(ax) return raise ValueError("Axes instance argument was not found in a figure.") Regards, -JJ |