Plot.plot({
style: "overflow: visible;",
insetLeft: 20,
marginTop: 60,
insetTop: 0,
marginLeft: 60,
insetRight: 180,
marks: [Plot.image(mmr_world_2016, {x:2012.9, y: 16, dx: 100, width:200, opacity: .1, src: "https://th.bing.com/th/id/OIP.x2pANN8PS88kejkKY7Kw8gAAAA?w=128&h=150&c=7&r=0&o=5&dpr=1.3&pid=1.7"}),
Plot.text(['The maternal mortality ratio (MMR) is defined as the number of maternal deaths during a given time period per 100,000 live births during the same time period.'], {x:2014, y: 6, opacity: 1, fill: "gray", fontSize: 20, textAnchor: "middle", lineWidth: 9, lineHeight: 1.4}),
Plot.barY([22.2], {fill: "orange", fillOpacity: 0.2}),
Plot.ruleX([2016, 2020]),
Plot.text(['2016'], {x:2016.1, y: .5, fontSize: 20, textAnchor: "start", fill: "gray"}),
Plot.text(['2020'], {x:2019.9, y: .5, fontSize: 20, textAnchor: "end", fill: "gray"}),
Plot.text(['Increase'], {x:2016.3, y: 16, fontSize: 25, textAnchor: "start", fill: "maroon"}),
Plot.text(['and'], {x:2017.5, y: 16, fontSize: 25, textAnchor: "start", fill: "black"}),
Plot.text(['Decrease'], {x:2018.1, y: 16, fontSize: 25, textAnchor: "start", fill: "forestgreen"}),
Plot.text(['in Maternal Mortality Ratio'], {x:2016.3, y: 14.6, fontSize: 25, textAnchor: "start", fill: "black"}),
Plot.line(mmr_world_2016, {x: "year", y: "MaternalMortalityRate", title: "Country", stroke: "Country", textAnchor: "start"}),
Plot.axisY({ tickSize: 0, fontSize: 0, ticks: 4,label: "Maternal Mortality Rate (per 100,000)", anchor: "left", labelAnchor: "center"}),
Plot.axisX({ tickSize: 0, fontSize: 0}),
Plot.text(mmr_world_2016, {x:2015.8, y: "MaternalMortalityRate"
, opacity: 1, fill: "Country", fontSize: 15,
text: d=>d.MaternalMortalityRate,
textAnchor: "end", lineWidth: 10,
filter: d=>d.year === 2016 & d.Country != "France" & d.Country != "Germany"
}),
Plot.text(mmr_world_2016, {x:2015.8, y: d=>d.MaternalMortalityRate - 0.5
, opacity: 1, fill: "Country", fontSize: 15,
text: d=>d.MaternalMortalityRate,
textAnchor: "end", lineWidth: 10,
filter: d=>d.year === 2016 & (d.Country === "France" | d.Country === "Germany")
}),
Plot.text(mmr_world_2016, {x:2020.2, y: "MaternalMortalityRate"
, opacity: 1, fill: "Country", fontSize: 15,
text: d=>d.MaternalMortalityRate + " ("+d.Country+")",
textAnchor: "start", lineWidth: 15,
filter: d=>d.year === 2020
}),
],
color: {
type: "categorical",
range: ["maroon", "maroon","maroon", "forestgreen", "forestgreen", "forestgreen", "forestgreen", "forestgreen", "forestgreen", "forestgreen" ],
domain: ["United States", "United Kingdom", "France", "Canada", "Germany", "Australia", "Netherlands (Kingdom of the)", "New Zealand", "Norway", "switzerland"],
legend: false,
},
height: 700,
width: 900
})