interactive plots

Almar Klein almar.klein at
Thu Jul 7 00:00:06 CEST 2011

On 6 July 2011 17:04, Mihai Badoiu <mbadoiu at> wrote:

> How do I do interactive plots in python?  Say I have to plot f(x) and g(x)
> and I want in the plot to be able to click on f and make it disappear.  Any
> python library that does this?

Visvis is a plotting toolkit that has good support for interactive use and

I'll even give you an example:

 import visvis as vv

 # Create to lines, increase line width (lw) for easier clicking

f = vv.plot([1,2,3,2], lc='r', lw=3)

g = vv.plot([2,1,4,3], lc='b', lw=3)

 # Create callback function

def deleteLine(event):


 # Enable picking and set callback

for fg in [f, g]:

fg.hitTest = True


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Python-list mailing list