你好,
我嘗試在下面的腳本中刪除 X 軸中的變數 age,但我無法透過這種方式刪除它,有人遇到過同樣的問題嗎?
注意:我知道可以用 Remove variable(index) 刪除它,但我事先不知道這個變數是否在圖中,所以我想避免透過索引意外刪除另一個圖。
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
gb = Graph Builder(
Size( 528, 464 ),
Show Control Panel( 0 ),
Variables( X( :sex ), X( :age, Position( 1 ) ), Y( :height ), Color( :sex ) ),
Elements( Points( X( 1 ), X( 2 ), Y, Legend( 17 ) ) )
);
wait(2);
gb << Remove Variable( {:age, Role( "X" ), Position( 1 )} );
gb << get variables();
添加內部位置時也有效:
gb << Remove Variable( {:age, Role( "X" ), Position( 1 ), Inner Position(1)} );
