example using matplotlib in realtime