Plot.plot({
marks: [
Plot.dot(scoresCombined, {
x: "PC1",
y: "PC2",
fill: "season",
r: 4
}),
Plot.arrow(loadings, {
x1: 0, x2: d => d.PC1* scalingFactor,
y1: 0, y2: d => d.PC2 * scalingFactor,
}),
Plot.text(loadings, { x: d => d.PC1 * scalingFactor * 1.1 , y: d => d.PC2 * scalingFactor * 1.1, text: "Variable" }),
],
color: { legend: true }
})