JSL在图上创建线你好,
所以我正在尝试创建类似于此脚本的红线
Names Default To Here( 1 );
dt = Current Data Table();
listX = {"1"};
listY = {"test1", "test2", "test3"};
lowLine = 3;
highLine = 5;
bivExpr = Expr(
Bivariate(
Y( Eval List( listY ) ),
X( Eval List( listx ) ),
Fit Spline( 1, Standardized, {Line Color( "Blue" )} ),
SendToReport(
Dispatch(
{},
"Bivar Plot",
FrameBox,
{Add Graphics Script(
2,
Description( "Script" ),
Pen Color( "Red" );
Line Style( "dashed" );
X Function( lowLine, x );
X Function( highLine, x );
), Grid Line Order( 1 ), Reference Line Order( 3 )}
)
)
)
);
bivExpr;我的表DT是这样的:
| 团体 | 测试1 | 测试2 | 测试3 | 1个 | 1个 |
| BL | 1个 | 1个 | 1个 | 1个 | 1个 |
| BL | 2个 | 2个 | 2个 | 2个 | 65岁 |
| BL | 23 | 3 | 6 | 1个 | 1个 |
| POR | 2个 | 2个 | 2个 | 2个 | 2个 |
| 值1 | 1个 | 1个 | 1个 | 3 | 4 |
| POR | 5 | 7 | 2个 | 2个 | 2个 |
| 值1 | 7 | 5 | 1个 | 7 | 3 |
| 值2 | 2个 | 2个 | 2个 | 2个 | 2个 |
| 值0 | 8 | 1个 | 1个 | 1个 | 6 |
结果:

我的问题是如何为每个图形创建不同的线(对于第一个3-5来说,对于第二个2-7来说是动态的,依此类推)
谢谢!
脚本编写回复:JSL在图上创建线使用参考线是我将如何处理此问题

Names Default To Here( 1 );
dt = Current Data Table();
listX = {"1"};
listY = {"test1", "test2", "test3"};
lowList = {3, 2, 1};
highList = {5, 7, 9};
lowLine = 3;
highLine = 5;
bivExpr = Expr(
biv = Bivariate(
Y( Eval List( listY ) ),
X( Eval List( listx ) ),
Fit Spline( 1, Standardized, {Line Color( "Blue" )} )
);
For( i = 1, i <= N Items( listY ), i++,
Report( biv[i] )[AxisBox( 2 )] << add Ref Line( lowList[i], "Dashed", "Red" );
Report( biv[i] )[AxisBox( 2 )] << add Ref Line( highList[i], "Dashed", "Red" );
);
);
bivExpr;