Forums

Matplotlib dynamic graph in web2py

I will fetch latitude and longitude present in the database and will reflect it on my world map. Then, when a new data (lat,lon) gets inserted in the database, i will update my graph; old point will be erased and a new point will be presented (with a dot) on the graph. Like this; as long as new points will be coming in the database, the map will show it there on the page itself. Can someone help me with some codes, please ?

This (https://sukhbinder.wordpress.com/2012/10/09/gif-animation-in-matlab-in-3-steps/) shows how to generate a GIF in Matlab and should help you.

I can use matplotlib only, not matlab. I'm restricted to 'matplotlib with web2py'.

You can either do that with an auto-refreshing page where matplotlib generates the graph based on what's in the database at the time or you could use Javascript to render the chart in the browser and update when there is new data. Have a look at Bokeh

The data is coming at a very fast rate thats why can't do it with auto-refresh.

Do you have tried Bokeh. If you try it and do something functional I will be interested.

Sorry for my english and this uggly "Do you have tried ?" instead of *"Did you try ?".

Ok..thank-you..I will try and post an update if I'm successful.