Here is a matplotlib based version:
# CONTROLLER:
def image_mat():
import sys
import matplotlib
matplotlib.use('Agg')
from pylab import plot, savefig
plot([1,2,3])
response.headers['Content-Type']="image/png"
savefig(response.body)
return response.body.getvalue()
# view
<img src="{{=URL(r=request,f='image_mat')}}"/>
=> this can be extended for interactive plotting using
* form as input
* numpy /scipy as support for the math
@Massimo
You may add this to the examples.
This does not work on appengine, there is no save method.What is the appengine way of doing this?