Plot.plot({
width :1000,
height : 400,
grid : true,
y: {
domain: [1, 4000]
},
marks: [
Plot.barY(bd.filter(x=> x.data_b==select_date && x.pol=='M'), {x: "age", y: "count_b", fill: "grey" , fillOpacity: 0.4}),
Plot.barY(bd.filter(x=> x.data_b==select_date && x.pol=='F'), {x: "age", y: "count_b", fill: "red", fillOpacity: 0.4}),
Plot.ruleY([0]),
Plot.text(bd.filter(x=> x.data_b==select_date && x.pol=='M'), {x: "age", y: "count_b", fill: "black", dy: -10, text: d=>d["count_b"]}),
Plot.text(bd.filter(x=> x.data_b==select_date && x.pol=='F'), {x: "age", y: "count_b", fill: "red" , dy:-80, text: d=>d["count_b"]}),
],color: { legend: true, range:["orange", "brown"]},
marginLeft: 100})