Our World Statistics Day conversations have been a great reminder of how much statistics can inform our lives. Do you have an example of how statistics has made a difference in your life? Share your story with the Community!
Choose Language Hide Translation Bar
Highlighted

Stacking overlay plots

Hi,

I thought I might be able to stack overlay plots into one window in a script like this:

Distribution(
stack( 1 ),
Overlay Plot(
X( :static_clear_rel ),
Y( :MxBmin, :Pred Formula MxBmin ),
Sort X( 0 )
),
Overlay Plot(
X( :static_clear_rel ),
Y( :MxBmax, :Pred Formula MxBmax ),
Sort X( 0 )
),
)

But no window pops up, and I get no warnings/errors. If I change it to the following, I do get 2 separate windows to popup:

//Distribution(
// stack( 1 ),
Overlay Plot(
X( :static_clear_rel ),
Y( :MxBmin, :Pred Formula MxBmin ),
Sort X( 0 )
);
Overlay Plot(
X( :static_clear_rel ),
Y( :MxBmax, :Pred Formula MxBmax ),
Sort X( 0 )
);
//)
3 REPLIES 3
Highlighted
afterword
Level IV

Re: Stacking overlay plots

You may need to enclose the Overlay scripts in a

New Window("Window Name", XXXX)

Replace the XXXX with the scripts you're trying to paste together. You can format the output using horizontal and vertical list boxes (vlistbox and hlistbox).
Highlighted
chungwei
Staff

Re: Stacking overlay plots

Another way would be to stack your data, then just use one overlay with grouping column.

Re: Stacking overlay plots

You can use the frame box copy and paste feature to stick the charts together.

new window("my wnd",
c1= Overlay Plot(
X( :static_clear_rel ),
Y( :MxBmin, :Pred Formula MxBmin ),
Sort X( 0 )
);
c2 = Overlay Plot(
X( :static_clear_rel ),
Y( :MxBmax, :Pred Formula MxBmax ),
Sort X( 0 )
);
);

// copy the framebox of the first chart and drop it on the second.
fb1 = (c1<< report())[framebox(1)];
fb1 << copy frame contents();
fb2 = (c2<< report())[framebox(1)];
fb2 << paste frame contents();
// you can now delete the first chart if you want.
c1 << delete();
Article Labels

    There are no labels assigned to this post.