Matplotlib OO - Figure-Subplot(or axes)

I add another question linked to the previouns one.
as we sepcify two times the link between figure and subplot (axes) when we make subplot manually:
ax = Subplot(fig,111)
fig.add_subplot(ax)

Is it possible after that to break the link between a figure and a subplot and to add the subplot to another figure?

Thanks a lot for any answer,
Philippe Collet

Philippe,

I believe that Figure.delaxes() does what you want:

  # create a subplot and add it to a figure
  ax = Subplot(fig,111)
  fig.add_subplot(ax)

  # remove the subplot
  fig.delaxes(ax)

  # add it to another figure
  anotherFigure.add_subplot(ax)

Ken