matplotlib button problem

Zielinski jerzy.zielinski at gmail.com
Wed Jan 24 22:37:22 CET 2007


Hi,

Recently I started to use matplotlib with python. Now I would like to
have interaction with my plots. Here is the problem:

I have a long vector of data, to long to display it on one picture,
because of, well you know to much data to big mess... so I decided to
extract some data from long_vector to short_vector with 100 elements.
So I have:
   data_position = 1
   interval = 100
   for i in range (0, interval):
      short_vector[i] = long_vector[data_position*interval + i]

Then I plot it. works fine...
Now I created a button "next" I would like to press it and change the
data_position to +1 every time i press it, of course, and redraw the
picture. It can be a key on the keyboard, I don't care.

Bottom line: how to change the global variable with the button in
matplotlib, and redraw a picture using this variable

Thanks for help
Jerzy
jerzy.zielinski at gmail.com




More information about the Python-list mailing list