from collections import OrderedDict
import numpy as np
from valjean.javert.templates import (PlotTemplate, CurveElements,
                                      SubPlotElements)
bins = [np.array(['spam', 'egg', 'bacon']),
        np.array(['beer', 'wine', 'milk', 'tea with milk and sugar'])]
axnames = ['x', 'y']
v2d = np.arange(12).reshape(3, 4)
v1d = np.arange(4)
lsplts = []
lsplts.append(SubPlotElements(
    curves=[CurveElements(values=v2d, bins=bins, legend='Menus')],
    axnames=['Meat', 'Drink', 'Associations'], ptype='2D'))
lsplts.append(SubPlotElements(
    curves=[CurveElements(
        values=v1d, bins=bins[1:], legend='', index=1)],
    axnames=['Drink', 'Quantity'], ptype='1D'))
pltnd = PlotTemplate(subplots=lsplts)
from valjean.javert import mpl
mplplt = mpl.MplPlot(pltnd)
fig, _ = mplplt.draw()
