感謝您詳細提供的示例,所有問題(Q1,Q2)都已解決。
theList = {9, 10, [-1, -1, -1, -1]}; <BR />mat = Shape( Matrix( Index(<FONT color="#FF0000"> 0,</FONT> N Items( uni_bat ) - 1 ) ), <BR />N Items( uni_bat ) ) |/ [-1, -1, -1, -1, -1, -1, -1, -1];
如上所述,在您給我的腳本中,我可以通過在 N 項前面添加 0 來使結果完全符合我的要求。
再次感謝吉姆的友好回答!!!
請小心COVID19!
您可以生成圖例位置的動態部分並構建所需的列表
Names Default To Here( 1 );
uni_bat = {a, b, c, d};
theList = {9, 10, [-1, -1, -1, -1]};
mat = Shape( Matrix( Index( 1, N Items( uni_bat ) - 1 ) ), N Items( uni_bat ) - 1 ) |/
[-1, -1, -1, -1, -1, -1, -1, -1, -1,-1, -1];
insert into(theList, mat, 2);
show(theList);
然後將其插入到 Legend Position 消息中,如下面的簡化示例所示
Names Default To Here( 1 );
Open( "$SAMPLE_DATA/Big Class.jmp" );
gb = Graph Builder(
Show Control Panel( 0 ),
Variables(
X( :height ),
Y( :weight ),
Overlay( :sex )
),
Elements(
Points( X, Y, Legend( 3 ) ),
Smoother( X, Y, Legend( 4 ) )
)
);
theList = {3, 4, [2, 1]};
mat = [4,3];
insert into(theList,mat,2);
eval(parse("Report( gb )[LegendBox( 1 )] << Legend Position( "||char(theList)||" );"));您嘗試修改的 JSL 代碼可以使用發送到 Legend Box() 消息的消息更輕鬆地處理。下面是腳本索引中的條目,它給出了修改圖例位置的示例。使用此方法,您的 IF() 語句結構將按照您在示例中假設的方式工作。

去
幫助=>腳本索引
訪問上述顯示