如何将两种不同类型的图表水平合并到日志中?
////////////////////////////////////////Makes 'N' overlay plots. One each for each "Parameter Name"////////////////////////////////////////////////////////
overlayplot = table1 << Overlay Plot(
X( :column1 ),
Y( :Name( "Mean(Parameter Value)" ) ),
Grouping( :GROUP ),
SendToByGroup(
{:Parameter Name == Eval( :Parameter Name )},
Overlay Groups,
Connect Thru Missing( 1 ),
Connect Points( 1 ),
:Name( "Mean(Parameter Value)" )(Overlay Marker( 8 ), Line Width( "Thick" ))
),
By( :Parameter Name ),
);
////////////////////////////////////////Makes 'N' Oneway plots. One each for each "Parameter Name"////////////////////////////////////////////////////////
ttest_plot = table1 << Oneway(
Y( :Name( "Mean(Parameter Value)" ) ),
X( :GROUP ),
Plot Quantile by Actual( 1 ),
Line of Fit( 0 ),
Box Plots( 1 ),
Mean Diamonds( 0 ),
X Axis Proportional( 0 ),
Points Jittered( 1 ),
SendToReport(
Dispatch(
{},
"Oneway Plot",
FrameBox,
{DispatchSeg(
Box Plot Seg( 1 ),
{Box Type( "Outlier" ), Confidence Diamond( 0 ),
Shortest Half Bracket( 0 ), Line Color( "Red" )}
), DispatchSeg(
Box Plot Seg( 2 ),
{Box Type( "Outlier" ), Confidence Diamond( 0 ),
Shortest Half Bracket( 0 ), Line Color( "Red" )}
)}
)
),
By( :Parameter Name )
);
上面的代码从我的数据中制作了相同数量的叠加图和单向图。 有 84 个唯一的“参数名称”,所以我得到 84 个叠加图和 84 个单向图。
我试图将它们合并到一个日志中,以便对于每个参数,我都可以在叠加图旁边获得单向图……然后是垂直的后续图。
我怎样才能做到这一点?
这是我需要的输出

这是我得到的输出

@txnelson #JMP
图形脚本编写Re: 如何将两种不同类型的图表水平合并到一个日志中?您可以尝试使用 H 列表框将它们并排设置,但很可能会遇到不同报告大小的一些问题,并且必须以某种方式处理。 下面是一个有两个不同选项的例子,它可能会给出一个想法如何做到这一点(我没有真正使用过期刊,所以这个例子的一部分可能有点糟糕):
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
/*with by*/
graph1 = Expr(dt << Oneway(Y(:height), X(:age), By(:sex)));
graph2 = Expr(dt << Graph Builder(
Show Control Panel(0),
Show Legend(0),
Variables(X(Transform Column("Row", Formula(Row()))), Y(:height), Group Y(:age)),
Elements(Points(X, Y, Legend(1))),
By(:sex)
));
nw = new window("",
h list box(
vlistbox(graph1),
vlistbox(graph2)
)
);
nw << journal window;
nw << close window;
stop();
/* without by*/
graph1 = Expr(dtTemp << Oneway(Y(:height), X(:age)));
graph2 = Expr(dtTemp << Graph Builder(
Show Control Panel(0),
Show Legend(0),
Variables(X(Transform Column("Row", Formula(Row()))), Y(:height), Group Y(:age)),
Elements(Points(X, Y, Legend(1)))
));
nw = new window("",
vlb = v list box();
);
nw << Journal Window;
nw << close window;
byVals = Associative Array(dt:sex) << get keys;
For(i = 1, i <= N Items(byVals), i++,
dt << Select Where(:sex == byVals[i]);
dtTemp = dt << Subset(Selected Rows, all columns);
hlb = V List Box(
TextBox(byVals[i]),
Lineup box(N Col(2),
graph1,
graph2
)
);
hlb << Journal;
Close(dtTemp, no save);
);
Re: 如何将两种不同类型的图表水平合并到一个日志中?这是您的脚本的返工,我相信这将为您的脚本提供一个良好的开端

Names Default To Here( 1 );
dt = Open( "$sample_data/big class.jmp" );
overlayplot = dt << Overlay Plot(invisible,
X( :height ),
Y( :Name( "weight" ) ),
Grouping( :sex ),
SendToByGroup(
{:age == Eval( :age )},
Overlay Groups,
Connect Thru Missing( 1 ),
Connect Points( 1 ),
:Name( "weight" )(Overlay Marker( 8 ), Line Width( "Thick" ))
),
By( :age )
);
////////////////////////////////////////Makes 'N' Oneway plots. One each for each "Parameter Name"////////////////////////////////////////////////////////
ttest_plot = dt << Oneway(invisible,
Y( :weight ),
X( :sex ),
Normal Quantile Label( 0 ),
Box Plots( 1 ),
X Axis Proportional( 0 ),
Points Jittered( 1 ),
by( :age ),
SendToReport(
Dispatch(
{},
"Oneway Plot",
FrameBox,
{DispatchSeg(
Box Plot Seg( 1 ),
{Confidence Diamond( 0 ), Line Color( "Red" )}
), DispatchSeg(
Box Plot Seg( 2 ),
{Confidence Diamond( 0 ), Line Color( "Red" )}
)}
)
)
);
// Create the output window
nw = new window("The Output", lub = lineup Box( NCol(2)));
// Find the numeber of by groupws
summarize(dt, bygroups = by(:age));
numByGroups = nitems(bygroups);
For(i=1,i<=numByGroups,i++,
lub<<APPEND></APPEND>
注意:我手动缩小了叠加图的大小,您需要添加 JSL 以正确设置帧大小。
Re: 如何将两种不同类型的图表水平合并到一个日志中?谢谢你。 完美地工作。 只需要设置帧大小。