如何將兩種不同類型的圖表水平合併到日記中?
////////////////////////////////////////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);
);