function plotFoundCompare(data) {
return Plot.plot({
width:500,
height:300,
y: {label:null, tickSize:0, label:null, axis:null},
x: {grid:true, tickSize:0, label: "Distance (km)"},
color: {scheme: "Tableau10"},
facet: {data: data, y: "found", label:null},
marginLeft:80,
marginBottom:40,
marks: [
Plot.areaY(data,
Plot.binX({y: 'count'},{x: "distanceKM", fill: 'found', fillOpacity: 0.85, curve: 'basis', thresholds:40, stroke:'found', strokeWidth:2}
)),
markPointInterval(data,
{y:0, x:"distanceKM", text: "distanceKM", fillText:"white", fill: 'black'}),
Plot.dot(data, {x: d => d.distanceKM, y: d=> -10 + Math.random()*3, r:4,
fill: "found", dy:-10, stroke:"white", strokeWidth:0.5,
channels: {species: "species", found: "found", distance: "distanceKM"},
tip: {format: {fill: false, x: false, y: false, fy: false}}}),
]
})}