我不知道这是否是解决方案,但请尝试转向适合窗口关。

Graph Builder(
Size( 457, 479 ),
Fit to Window( "Off" ),
Variables( X( :weight ), Y( :height ) ),
Elements( Points( X, Y, Legend( 3 ) ), Smoother( X, Y, Legend( 4 ) ) )
);
全面披露 - 与 Graph Builder 相比,我更喜欢 JSL 中较旧的图形绘制程序,但我正在认真尝试切换。
我遇到了一个问题,我正在动态地向日志添加图表,并试图非常严格地控制图表大小,以便轴和值水平排列。我正在用 JSL 构建一个包含多个项目的 H 列表框,将该 H 列表框发送到日志,然后对另一个参数执行相同操作。但是,当我使用 Graph Builder 时,Size 属性似乎被完全忽略,并且所有 GraphBuilder 最终都显示为 300x300px。当我通过其他绘图路径(变异图、控制图、叠加图)构建图表时,这种情况不会发生。它有效。
我尝试用不同的方法解决这个问题,并编写了一些测试代码,以完全相同的方式将 H 列表框添加到新窗口而不是日志中,一切都按预期工作。请参见下图,左侧是错误的日志输出,右侧是正确的“新窗口”输出。有人知道日志发生了什么,需要采取哪些步骤来缓解?

Windows JMP 14.2
使用 Big Class 示例数据表的示例测试代码。
//Uses BigClass example data
// Create array of parameters
ParameterArray = {"height", "weight"};
numbatches = nrows(Current Data Table());
wind = New Window( "Example");
// Loop through parameters
for (i = 1, i <= N Items(ParameterArray),i++,
ColName = ParameterArray[i];
// Create charts
xBox = H List Box ();
xBox << append( gbbp = Graph Builder(
Size( 150, 300 ),
Show Control Panel( 0 ),
Variables( Y( Column( ColName ) ), Overlay( :sex ) ),
Elements( Box Plot( Y, Legend( 2 ) ) ),
SendToReport(
Dispatch(
{},
ColName,
ScaleBox,
{Label Row( {Major Grid Line Color( -14277081 ), Show Major Grid( 1 )} )
}
),
Dispatch( {}, "400", LegendBox, {Set Title( "" )} )
)
);
);
xBox << append( gb = Graph Builder(
Size( 900, 300 ),
Show Control Panel( 0 ),
Legend Position( "Inside Left" ),
Variables( X( :age ), Y( Column( ColName ) ), Overlay( :sex ) ),
Elements( Line( X, Y, Legend( 32 ) ) ),
SendToReport(
Dispatch(
{},
"Graph Builder",
OutlineBox,
{Set Title( ColName || " Chart" )}
),
Dispatch(
{},
"graph title",
TextEditBox,
{Set Text( ColName || " Chart" )}
),
Dispatch( {}, "400", LegendBox, {Sides( "Left" )} )
)
);
);
// Save to journal
xBox << journal;
wind << append(xBox);
);
你好
我刚刚遇到这种情况,想将几个箱线图和其他内容一起放入一份报告中。至少不只是我一个人遇到这种情况!
这个问题有修复吗?这是 bug 还是功能?
如何完成您所做的事情(“建立一个窗口然后将其发送到日志”)?
努力开始使用 JSL,因为它似乎...与我使用过的任何其他语言都有点不同,而且我没有时间花深入理解它。
有没有一种不涉及图形生成器的制作箱线图的方法?
也在努力查阅文档,但这没有帮助!
谢谢
约翰
我认为尺寸问题的主要原因是报告在记入日志时不是窗口的一部分。这可能应该被视为一个错误,我会报告它,但解决这个问题的一种方法是简单地重新排序命令以将报告添加到窗口并保存日志:
// Add reports to window
wind << append(xBox);
// Save to journal
xBox << journal;
希望有帮助,
-和