Am in a stage in my application where am trying to comeup with a statistics interface(graphs,charts) based on the data in the sqlalchemy database am using. However I came across matplotlib and i am trying to get along along with it but still failing to implement it. Am using Mako templates. Am requesting on how to go about this.Thanks heres sam view's code.
@view_config(route_name="d", renderer="./templates/d.mako")
def d(request):
try:
rows = DBSession.query(Song.duration, Song.price).all()
duration,price = zip(*rows)
plt.plot(duration,price)
##show()
except DBAPIError:
return Response(conn_err_msg, content_type='text/plain', status_int=500)
return { 'project': 'beatstore'}