import matplotlib.pyplot as plt
from cellcomplex.property_topomesh import PropertyTopomesh
from cellcomplex.property_topomesh.utils.matplotlib_tools import mpl_draw_topomesh, mpl_draw_incidence_graph

topomesh = PropertyTopomesh()
topomesh.add_wisp(0,0)
topomesh.add_wisp(0,1)
topomesh.add_wisp(0,2)
topomesh.add_wisp(0,3)
topomesh.update_wisp_property('barycenter',0,{0:[-1,-1,0],1:[1,-1,0],2:[-1,1,0],3:[1,1,0]})

figure = plt.figure()
figure.clf()

figure.add_subplot(1,2,1)
figure.gca().axis('equal')
mpl_draw_topomesh(topomesh,figure,0,color='m',plot_ids=True)
figure.gca().axis('off')

figure.add_subplot(1,2,2)
figure.gca().axis('equal')
mpl_draw_incidence_graph(topomesh,figure,plot_ids=True)
figure.gca().axis('off')

figure.set_size_inches(10,5)
figure.tight_layout()