From: John H. <jd...@gm...> - 2009-08-03 12:41:29
|
On Mon, Aug 3, 2009 at 6:55 AM, Bas van Leeuwen<le...@gm...> wrote: > PS, @John, I'd like to try the imshow approach first because it is not > in a figure but in a QT frame containing several subplots. But thank > youfor the suggestion, I will try if the imshow approach appears > fruitless. All matplotlib axes and subplots live in figures, you just may not know it. The call to gca in your code below: >> ax = gca() >> limx = ax.get_xlim() automatically creates a figure and adds the axes to is. So you can still access the figure, eg fig = ax.figure You can then call figimage # transform from axes coorrs (x,y) -> display coords (xo,yo) xo, yo = ax.transData.transform_point((x,y)) fig.figimage(Z, xo, yo) where Z is your image array JDH |