On Thu, Mar 6, 2008 at 3:00 AM,  <[EMAIL PROTECTED]> wrote:
> "Anthony Floyd" <[EMAIL PROTECTED]> writes:
>
>  > I would like to 'watermark' a plot. That is, display an image 'under'
>  > several lines. [...] I've tried using figure.figimage, but that only
>
> > draws the watermark 'outside' the plot area. Fair enough.
>
>  The background of the axes object is called a "frame", and you want to
>  not draw it at all (pass frameon=False to add_axes) or make it
>  translucent:
>
>  fig=figure(...)
>  fig.figimage(...)
>  ax=fig.add_subplot(...)
>  ax.get_frame().set_alpha(0.5)

For the archives, I found that the best way to do this was to set the
frame alphas to 0.0, and to draw the watermark directly in the canvas'
.draw() routine.  This allows for smooth panning and resizing.
Otherwise, when trying to redraw the watermark in response to an
EVT_SIZE (I'm using wx), two problems would come up.  1) The redraw
routine would happen before the frame/panel/canvas/figure 'knew' what
its new size was, causing some weird 'jumping around' artefacts, and
2) There'd be some serious flicker because the plot would be drawn
then the watermark would be drawn.

A>

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to