我需要帮助才能使这个循环正常工作大家好。
Names Default To Here( 1 );
dt = Current Data Table();
For ( i = 1951, i <= 2021, i++,
gb = dt << Bivariate(
Y( :PRCPC ),
X( :Mes ),
Fit Each Value( {Line Color( {208, 64, 86} )} ),
Fit Line( {Line Color( {45, 177, 53} )} ),
Fit Spline( 20.13724, {Line Color( {64, 110, 211} )} ),
Where( :Any == [i]),
SendToReport(
Dispatch( {}, "Bivar Plot", FrameBox, {Frame Size( 486, 411 )} ),
Dispatch( {}, "Linear Fit", "Summary of Fit",OutlineBox, {Close( 1 )} )
),
);
gb << Save Picture( "/Users/mgc/Desktop/" || :Any == [i] || ".png", PNG );
),
.先感谢您
脚本回复:我需要帮助才能使这个循环正常工作在 Where() 子句中,您需要删除“i”变量周围的 {}。
在保存图片中,您需要将“i”的值转换为字符,然后才能连接到字符串。
Names Default To Here( 1 );
dt = Current Data Table();
For ( i = 1951, i <= 2021, i++,
gb = dt << Bivariate(
Y( :PRCPC ),
X( :Mes ),
Fit Each Value( {Line Color( {208, 64, 86} )} ),
Fit Line( {Line Color( {45, 177, 53} )} ),
Fit Spline( 20.13724, {Line Color( {64, 110, 211} )} ),
Where( :Any == i),
SendToReport(
Dispatch( {}, "Bivar Plot", FrameBox, {Frame Size( 486, 411 )} ),
Dispatch( {}, "Linear Fit", "Summary of Fit",OutlineBox, {Close( 1 )} )
),
);
gb << Save Picture( "/Users/mgc/Desktop/" || char(i) || ".png", PNG );
);