如何将两种不同类型的图表水平合并到日记中?
////////////////////////////////////////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 个单向图。
我试图将它们合并到日志中,以便对于每个参数,我得到叠加图旁边的单向图......然后是垂直的后续图。
我怎样才能做到这一点?
这是我需要的输出

这是我得到的输出

@tx尼尔森#JMP
内容组织回复:如何将两种不同类型的图表水平合并到日记中?谢谢。 效果很好。 只需要设置框架大小。
回复:如何将两种不同类型的图表水平合并到日记中?这是对您的脚本的修改,我相信这会给您的脚本带来良好的开端

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 才能正确设置帧大小。
回复:如何将两种不同类型的图表水平合并到日记中?您可以尝试使用 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);
);