[Flask] Creating a bar chart with std and displaying

Jani Šumak jani.sumak at gmail.com
Fri Jul 22 16:33:48 EDT 2016


Hi Stephen,

saving the plot to a .png and than rendering a jinja2 template would be one
way to do it, but it'd recommend something like this:
http://bokeh.pydata.org/en/latest/

The documentation has some examples for working with Pandas dataframes
<http://bokeh.pydata.org/en/0.12.0/docs/user_guide/charts.html> and you can
find examples using Bokeh with Flask on github.

Hope that helps!

Cheers, Jani

On Fri, Jul 22, 2016 at 9:39 PM Mazzei, Stephen Andrew <
Stephen.Mazzei at asrcfederal.com> wrote:

> Good afternoon, another quick question.
>
> I have the following
> Out[83]: grouped.head()
>
> Date    Wall Clock
> 0       2016-01-24      3348
> 1       2016-01-24      3337
> 2       2016-01-24      3370
> 3       2016-01-24      3343
> 4       2016-01-24      3345
> 6       2016-05-15      3381
> 7       2016-05-15      3432
> 8       2016-05-15      3417
> 9       2016-05-15      3444
> 10      2016-05-15      3412
>
> Where date is the first column and the "Wall Clock" is the second column
>
> I am trying to mark a bar chart showing the mean of the days wall clock
> times, with their std. I have the following
>
> means = grouped.mean()
> errors = grouped.std()
> fig, ax = plt.subplots()
> means.plot.bar(yerr=errors, ax=ax, legend=None))
>
> Which does work, though kind of hard to see. Is there a better way to do
> this? If this is a fine way of doing this, my next question is how do I
> present this to flask front end? Do I need to save this to a .png and then
> load the .png on the server?
>
> Thank you
>
>
> ---
> Stephen A. Mazzei
> Systems Administrator | AFDS, ASRC Federal Data Solutions - P&G HPC
> Account | 513-634-9965
>
> ________________________________
>
> The preceding message (including attachments) is covered by the Electronic
> Communication Privacy Act, 18 U.S.C. sections 2510-2512, is intended only
> for the person or entity to which it is addressed, and may contain
> information that is confidential, protected by attorney-client or other
> privilege, or otherwise protected from disclosure by law. If you are not
> the intended recipient, you are hereby notified that any retention,
> dissemination, distribution, or copying of this communication is strictly
> prohibited. Please reply to the sender that you have received the message
> in error and destroy the original message and all copies.
> _______________________________________________
> Flask mailing list
> Flask at python.org
> https://mail.python.org/mailman/listinfo/flask
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/flask/attachments/20160722/dddb4b6f/attachment.html>


More information about the Flask mailing list