Skip to main content

Generate html dashboards using matplotlib, Jinja2, and Markdown.

Project description

Matplotboard

A utility to generate html dashboards using matplotlib. Matplotboard makes it easy to wrap your plotting functions and embed them into a Markdown document. This is best demonstrated with an example.

import numpy as np
import matplotlib.pyplot as plt

from matplotboard import (decl_fig, render, generate_report)


@decl_fig
def cool_fig():
    xs = np.linspace(-10,10, 100)
    ys = xs**2
    plt.plot(xs, ys)


@decl_fig
def fig_with_args(amp, freq):
    '''
    A plot of a sine wave with configurable amplitude and frequency.
    '''
    xs = np.linspace(-np.pi, np.pi, 100)
    ys = amp*np.sin(xs*freq)
    plt.plot(xs, ys)


if __name__ == '__main__':
    figures = {'my_cool_fig': cool_fig,
               'slow': (fig_with_args, (1, np.pi)),
               'fast': (fig_with_args, (0.75, 3*np.pi)),
               }

    render(figures)
    generate_report(figures, 'Report',
                    source=__file__,
                    body="""
# Making **Awesome Dashboards**

Sometimes you just want to push out a static html page with plots and relevant
commentary. For example, what does a parabola look like?

fig::my_cool_fig

There we go, `matplotboard` also supports plotting functions that take arguments.

fig::slow
fig::fast

    """)

You can view the fantastic generated report here

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

matplotboard-0.2.1.tar.gz (18.9 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page