{
const svg = d3.create("svg")
.attr("width", plotWidth + plotMargin.left + plotMargin.right)
.attr("height", plotHeight + plotMargin.top + plotMargin.bottom);
const mainGroup = svg.append("g")
.attr("transform", `translate(${plotMargin.left}, ${plotMargin.top})`);
const XAxisGroup = mainGroup.append("g")
.attr("transform", `translate(0, ${plotHeight - plotMargin.bottom})`)
.call(d3.axisBottom(xScale));
XAxisGroup.append("text")
.attr("x", plotWidth /2)
.attr("y", 40)
.attr("fill", "black")
.attr("text-anchor", "middle")
.attr("font-size", "14px")
.text("goals_for");
const YAxisGroup = mainGroup.append("g")
.attr("transform", `translate(${plotMargin.left}, 0)`)
.call(d3.axisLeft(yScale));
YAxisGroup.append("text")
.attr("transform", "rotate(-90)")
.attr("x", -plotHeight/2)
.attr("y", -40)
.attr("fill", "black")
.attr("text-anchor", "middle")
.attr("font-size", "14px")
.text("goals_against");
const circlesGroup = mainGroup.append("g")
render_data(circlesGroup, teams_stats21);
return svg.node();
}