Aman Thakral, on 2011-02-09 15:40,  wrote:
> Hi,
> 
> I was just wondering, how would I go about redrawing only a single element
> (i.e. an artist)? I know that matplotlib.artist.Artist has a draw() method
> that accepts a renderer as the argument.
> 
> I tried something along the lines of:
> 
> renderer = fig.canvas.get_renderer()
> title = ax.set_title("This is my title")
> title.draw(renderer)
> 
> But have not had any luck.  I'm not sure what I'm missing.  Any help would
> be greatly appreciated.

Hi Aman,

To see the affects of rendering something new, you can use:

  ax.figure.canvas.blit(ax.title.get_bbox_patch())

If you intend to change the title several times, however, the
above will just keep over-plotting on top of the previous titles.
In that case, you'll want to use the animated=True keyword and
canvas.restore_region along with the blitting -- see the
animation examples for how to do that.

best,
-- 
Paul Ivanov
314 address only used for lists,  off-list direct email at:
http://pirsquared.org | GPG/PGP key id: 0x0F3E28F7 

Attachment: signature.asc
Description: Digital signature

------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to