回复:如何使用組合框跳過圖例的某些列?您在示例腳本的末尾錯過了一個 ) 。 也請使用插入菜單中的 標籤來粘貼代碼。 它應該是這樣的:
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Animals.jmp", invisible);;
legend_list = {"subject","season"};
gb_default = Expr(
Graph Builder(
Size( 544, 356 ),
Show Control Panel( 0 ),
Legend Position( "Bottom" ),
Fit to Window( "Off" ),
Variables( X( :species ), Y( :miles ), Color( :subject ) ),
Elements( Points( X, Y, Legend( 14 ) ) ),
SendToReport( Dispatch( {}, "400", LegendBox, {Orientation( "Horizontal" ), Sides( "Left" )} ) )
)
);
gb_change = Expr(
Graph Builder(
Size( 544, 356 ),
Show Control Panel( 0 ),
Legend Position( "Bottom" ),
Fit to Window( "Off" ),
Variables( X( :species ), Y( :miles ), Color( Column( dt, ycol ) ) ),
Elements( Points( X, Y, Legend( 14 ) ) ),
SendToReport( Dispatch( {}, "400", LegendBox, {Orientation( "Horizontal" ), Sides( "Left" )} ) )
)
);
nw = New Window( "Animals Monitoring ",
gb = gb_default;
lbcontent = Lineup Box( N Col( 10 ),
Spacer Box( Size( 1, 0 ) ),
Text Box( "Color: ", <<SET font="" size=""></SET>據我所知,您的代碼有效……那麼您的問題到底是什麼?

回复:如何使用組合框跳過圖例的某些列?使用列切換器怎麼樣?
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Animals.jmp", invisible);;
legend_list = {"subject","season"};
Graph Builder(
Size( 544, 356 ),
Show Control Panel( 0 ),
Legend Position( "Bottom" ),
Fit to Window( "Off" ),
Variables( X( :species ), Y( :miles ), Color( :subject ) ),
Elements( Points( X, Y, Legend( 14 ) ) ),
Column Switcher( :subject, legend_list )
);如何使用組合框跳過圖例的某些列?你好,
我試圖僅將組合框中的某些列顯示為圖例,但我當前的代碼一一顯示該列。 有什麼方法可以跳過某些列嗎?
例如,在這種情況下,我只希望 :subject & :season 在圖例列表中。 這是我的代碼:
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Animals.jmp", invisible );
legend_list = {"subject", "season"};
gb_default = Expr(
Graph Builder(
Size( 544, 356 ),
Show Control Panel( 0 ),
Legend Position( "Bottom" ),
Fit to Window( "Off" ),
Variables( X( :species ), Y( :miles ), Color( :subject ) ),
Elements( Points( X, Y, Legend( 14 ) ) ),
SendToReport( Dispatch( {}, "400", LegendBox, {Orientation( "Horizontal" ), Sides( "Left" )} ) )
)
);
gb_change = Expr(
Graph Builder(
Size( 544, 356 ),
Show Control Panel( 0 ),
Legend Position( "Bottom" ),
Fit to Window( "Off" ),
Variables( X( :species ), Y( :miles ), Color( Column( dt, ycol ) ) ),
Elements( Points( X, Y, Legend( 14 ) ) ),
SendToReport( Dispatch( {}, "400", LegendBox, {Orientation( "Horizontal" ), Sides( "Left" )} ) )
)
);
nw = New Window( "Animals Monitoring ",
gb = gb_default;
lbcontent = Lineup Box( N Col( 10 ),
Spacer Box( Size( 1, 0 ) ),
Text Box( "Color: ", <<SET font="" size=""></SET>
提前感謝您的幫助。
圖形腳本視窗回复:如何使用組合框跳過圖例的某些列?兩個列切換器對我來說很不錯:
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Animals.jmp", invisible);;
legend_list = {"subject","season"};
Graph Builder(
Size( 544, 356 ),
Show Control Panel( 0 ),
Legend Position( "Bottom" ),
Fit to Window( "Off" ),
Variables( X( :species ), Y( :miles ), Color( :subject ) ),
Elements( Points( X, Y, Legend( 14 ) ) ),
Column Switcher( :subject, legend_list, Title( "Column Switcher Legend" ) ),
Column Switcher( :species, {:species, :season}, Title( "Column Switcher X" ) )
);在此示例中,由於使用相同的變量 Season 會發生一些衝突,但會通過錯誤消息妥善處理,並且可能不會在您的真實數據集中發生。

回复:如何使用組合框跳過圖例的某些列?嗨 Pauldeen,感謝您的意見。
我的代碼有效,但如果您在組合框中單擊季節,它不會改變圖例。
我現在擁有的兩個組合選項 -
單擊物種 - 它以圖例形式顯示物種
單擊季節 - 它顯示主題為圖例
而我想要的是,如果您單擊物種 - 它會將物種顯示為圖例,並且與季節相同。 希望澄清。 謝謝!

回复:如何使用組合框跳過圖例的某些列?應該提到我確實嘗試過使用列切換器,但我也會在工具中包含另一個組合框
一個組合框 - 用於改變 x 軸
一個組合框 - 用於更改圖例/顏色
列切換器在這方面做得不好,因為它一直在為我重複。
