y < c(2, 4, 6, 8, 10)
// 创建线性拟合线
```r
// 创建散点图
};
title: 'Scatter Plot',
legend: {x: 0, y: 1.5}
yaxis: {title: 'Y轴标签'},
legend("topleft", legend=c("Data", "Linear Fit"), col=c("blue", "red"), pch=c(16, NA), lty=c(NA, 1))
y: y,
var x = [1, 2, 3, 4, 5];
// 定义布局
name: 'Data',
type: 'scatter',
var layout = {
name: 'Linear Fit',
marker: { size: 8 }
// 定义数据
var trace2 = {
```
mode: 'markers',