回复:如何使用组合框跳过图例的某些列?您在示例脚本的末尾错过了一个 ) 。 也请使用插入菜单中的 标签来粘贴代码。 它应该是这样的:
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 轴
一个组合框 - 用于更改图例/颜色
列切换器在这方面做得不好,因为它一直在为我重复。
