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)
sbp1 = SubPlotElements(
    curves=[CurveElements(values=incv, bins=bins, legend='increase')],
    axnames=['x', 'y', 'spam'], ptype='2D')
sbp2 = SubPlotElements(
    curves=[CurveElements(values=decv, bins=bins, legend='decrease')],
    axnames=['x', 'y', 'spam'], ptype='2D')
sbp3 = SubPlotElements(
    curves=[CurveElements(values=incv/decv, bins=bins, legend='i/d')],
    axnames=['x', 'y', 'ratio'], ptype='2D')
sbp3.attributes.logz = True
pltnd = PlotTemplate(subplots=[sbp1, sbp2, sbp3], small_subplots=False)
from valjean.javert import mpl
mplplt = mpl.MplPlot(pltnd)
fig, _ = mplplt.draw()
