from collections import OrderedDict
import numpy as np
from valjean.javert.templates import (PlotTemplate, CurveElements,
                                      SubPlotElements)
bins = [np.arange(6), np.arange(17, step=2)]
axnames = ['x', 'y']
incv = np.arange(1, 41).reshape(5, 8)
decv = np.arange(1, 41)[::-1].reshape(5, 8)
lsplts = []
lsplts.append(SubPlotElements(
    curves=[CurveElements(values=incv, bins=bins, legend='increase'),
            CurveElements(values=decv, bins=bins, legend='decrease')],
    axnames=['x', 'y', 'spam'], ptype='2D'))
lsplts.append(SubPlotElements(
    curves=[CurveElements(
        values=incv/decv, bins=bins, legend='', index=1)],
    axnames=['x', 'y', 'ratio'], ptype='2D'))
pltnd = PlotTemplate(subplots=lsplts)
from valjean.javert import mpl
mplplt = mpl.MplPlot(pltnd)
fig, _ = mplplt.draw()
