自动从图例中排除特定项目你好,
我正在尝试创建一个 GraphBuilder 绘图,在“颜色”部分中使用“标志”列,如下所示

我希望我的脚本自动排除特定类别,在本例中说“PASS”。 我不知道该怎么做。 任何建议都会非常有帮助

谢谢。
For(i = 1, i <= N Items(y_cols), i++,
y_name = Char(y_cols[i]);
x_name = Char(x_col[1]);
gb = dt << Graph Builder(
Size(700, 350),
Show Control Panel(0),
Show Footer(0),
Variables(X(x_col[1]), Y(y_cols[i]), Color( :Flag )),
Elements(Points(X, Y, Legend(24))),
invisible,
SendToReport(
Dispatch(
{},
"Graph Builder",
OutlineBox,
{Set Title( y_name || " vs " || x_name ), Image Export Display( Normal )}
),
Dispatch(
{},
"Graph Builder",
FrameBox,
{Marker Size( 5 ), Transparency(1)}
),
Dispatch(
{},
"graph title",
TextEditBox,
{Set Text( "" )}
),
Dispatch(
{},
"X title",
TextEditBox,
{Set Text( "" )}
)
)
);
gb << Show Legend(1);
myVLB << append( Report( gb ) );
gb << delete;
);自动化和脚本编写基础数据分析和建模内容组织数据探索和可视化回复:自动从图例中排除特定项目您想隐藏标记吗? 难道这不会让读者感到困惑吗,因为情节中有标记,但根本没有对它们进行解释?
我不确定除了交互式执行然后复制脚本之外是否有任何非常简单的方法可以做到这一点。 根据 JMP 创建的脚本,这看起来与图例项位置相关(似乎索引从 0 开始...并且索引 1 设置为 -1 以隐藏它)。
Graph Builder(
Variables(X(:height), Y(:weight), Color(:sex)),
Elements(Points(X, Y, Legend(18))),
SendToReport(Dispatch({}, "400", LegendBox, {Legend Position({18, [0, -1]})}))
)
这里可能是使用图例显示的更强大的选项(请参阅脚本索引中的 LegendBox 对象)
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
gb = dt << Graph Builder(
Size(534, 456),
Show Control Panel(0),
Variables(X(:height), Y(:weight), Color(:sex)),
Elements(Points(X, Y, Legend(1)))
);
lgnd = gb << Get Legend Display;
items = lgnd << Get Items;
For Each({item}, items,
show(item << get label);
If(item << Get Label == "M",
item << Set Visible(0)
)
);回复:自动从图例中排除特定项目非常感谢。 这有效。 我还有一个额外的疑问。 是否可以在此脚本中从外部导出自定义图例?