AW: Line2D and wx Backend

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

AW: Line2D and wx Backend

Bugzilla from
Yes - this code works at home and at work (Linux/windows). I fail to see why
mine won't. I checked the id's - they're correct

-----Ursprüngliche Nachricht-----
Von: John Hunter [mailto:[hidden email]]
Gesendet: Donnerstag, 25. August 2005 18:01
An: Schindler Benjamin
Cc: [hidden email]
Betreff: Re: [Matplotlib-users] Line2D and wx Backend

>>>>> "Schindler" == Schindler Benjamin <[hidden email]> writes:

    Schindler> Hi - I'm having problems - I don't get any line
    Schindler> displayed on my screen. My code looks as follows
    Schindler> (Init):

Make sure you are working with the line you think you are

Rather than doing this


do this
        self.line = Line2D([],[]

After you do this

            line =[source][0] # Retreive the line

check to make sure that id(line) and id(self.line) are the same.

Here is a simple example that binds events to adding line data.
Perhaps you can follow this (in wx you need to click on the figure
once before the keypress events will be processed)

from matplotlib.lines import Line2D
import matplotlib.numerix as nx
from pylab import figure, show

xdata = []
ydata = []
line = Line2D(xdata, ydata)

def add_data(event):
    if event.key!='a': return
    line.set_data(xdata, ydata)
fig = figure()
ax = fig.add_subplot(111)
ax.set_title("Press 'a' to add more data")
fig.canvas.mpl_connect('key_press_event', add_data)


SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement *
Matplotlib-users mailing list
[hidden email]