你好,
在 JMP Pro 17.2.0 中,我在 For 循环中使用“<< 添加参考线”命令,并希望前 3 条参考线标签显示在对面的轴上。我尝试过以下符号:
rpVarPlots1[i][AxisBox( 1 )] << Add Ref line( rUCL[i], "Solid", "Purple", "UCL=" || Char( rUCL[i] ), 1, Label Position("Opposite) );
rpVarPlots1[i][AxisBox( 1 )] << Add Ref line( rUCL[i], "Solid", "Purple", "UCL=" || Char( rUCL[i] ), 1, Label Settings( {Opposite Axis( 1 )} ) );
但我尝试过的方法均无效,并导致诸如“名称未解析:访问或评估‘标签位置’时的标签位置...”之类的错误。
有办法实现这个吗?下面是我的代码示例以及我想要做的事情。

For( i = 1, i <= z, i++,
Eval(Expr(
rpVarPlots1[i][AxisBox( 1 )] << Add Ref line( rUCL[i], "Solid", "Purple", "UCL=" || Char( rUCL[i] ), 1 );
rpVarPlots1[i][AxisBox( 1 )] << Add Ref line( rCL[i], "Solid", "Black", "CL=" || Char( rCL[i] ), 1 );
rpVarPlots1[i][AxisBox( 1 )] << Add Ref line( rLCL[i], "Solid", "Purple", "LCL=" || Char( rLCL[i] ), 1 );
rpVarPlots1[i][AxisBox( 1 )] << Add Ref line( center[i], "Solid", "Green", "pCL=" || Char( Round( center[i], 2 ) ), 2 );
rpVarPlots1[i][AxisBox( 1 )] << Add Ref line( center[i] - sigma[i], "Dashed", "Blue", "-1Sig=" || Char( Round( center[i] - sigma[i], 2 ) ), 1 );
rpVarPlots1[i][AxisBox( 1 )] << Add Ref line( center[i] + sigma[i], "Dashed", "Blue", "+1Sig=" || Char( Round( center[i] + sigma[i], 2 ) ), 1 );
rpVarPlots1[i][AxisBox( 1 )] << Add Ref line( center[i] - 3*sigma[i], "Solid", "Red", "pLCL=" || Char( Round( center[i] - 3*sigma[i], 2 ) ), 2 );
rpVarPlots1[i][AxisBox( 1 )] << Add Ref line( center[i] + 3*sigma[i], "Solid", "Red", "pUCL=" || Char( Round( center[i] + 3*sigma[i], 2 ) ), 2 );
rpVarPlots1[i][AxisBox( 1 )] << Add Ref line( center[i] - 4*sigma[i], "Dotted", "Dark Gray", "pLDL=" || Char( Round( center[i] - 4*sigma[i], 2 ) ), 1 );
rpVarPlots1[i][AxisBox( 1 )] << Add Ref line( center[i] + 4*sigma[i], "Dotted", "Dark Gray", "pUDL=" || Char( Round( center[i] + 4*sigma[i], 2 ) ), 1 );<BR />)));
使用“标签设置”时,您可能需要添加一个额外的参数(在我的示例中是第二个参数 1,用于设置透明度)。这对我来说确实有效,但我使用的是 JMP18。
Names Default To Here(1);
dt = open("$SAMPLE_DATA/Big Class.jmp");
gb = dt << Graph Builder(
Variables(X(:weight), Y(:height), Overlay(:sex)),
Elements(Points(X, Y, Legend(9)), Line Of Fit(X, Y, Legend(11)))
);
ab = Report(gb)[AxisBox(2)];
For(i = 1, i <= 3, i++,
ab << Add Ref Line(
50 + i * 5,
"Solid",
"Black",
"my label",
1,
1,
Label Settings({Label Position("Outside"), Opposite Axis(1)})
)
);