JMP允許將圖形基元添加到系統內的任何圖形輸出中。所以要產生下圖

您只需右鍵單擊本機圖形,然後選擇“自定義”。它會彈出一個窗口,允許您向圖形添加腳本。

然後,您可以獲取修改後的圖形,並執行如下所示的“保存圖形”:
Names Default To Here( 1 );
dt = open("$SAMPLE_DATA/big class.jmp");
Graph Builder(
Size( 528, 456 ),
Show Control Panel( 0 ),
Variables( X( :weight ), Y( :height ) ),
Elements( Points( X, Y, Legend( 5 ) ) ),
SendToReport(
Dispatch(
{},
"weight",
ScaleBox,
{Add Ref Line( 110, "Solid", "Black", "", 1 )}
),
Dispatch(
{},
"height",
ScaleBox,
{Add Ref Line( 60, "Solid", "Black", "", 1 )}
),
Dispatch(
{},
"Graph Builder",
FrameBox,
{Add Graphics Script(
2,
Description( "" ),
Transparency( 0.5 );
Fill Color( {1, 1, .5} );
left = Current Report()[axisbox( 1 )] << getmin;
top = Current Report()[axisbox( 2 )] << getmax;
right = Current Report()[axisbox( 1 )] << getmax;
bottom = Current Report()[axisbox( 2 )] << getmin;
Fill Color( {1, 1, .5} );
Rect( left, top, 110, 60, fill = 1 );
Fill Color( "red" );
Rect( 110, top, right, 60, fill = 1 );
Fill Color( "green" );
Rect( left, 60, 110, bottom, fill = 1 );
Fill Color( "orange" );
Rect( 110, 60, right, bottom, fill = 1 );
), Grid Line Order( 1 ), Reference Line Order( 3 ),
DispatchSeg(
TopSeg( 1 ),
{Set Script(
Transparency( 0.5 );
Fill Color( {1, 1, .5} );
left = Current Report()[axisbox( 1 )] << getmin;
top = Current Report()[axisbox( 2 )] << getmax;
right = Current Report()[axisbox( 1 )] << getmax;
bottom = Current Report()[axisbox( 2 )] << getmin;
Fill Color( {1, 1, .5} );
Rect( left, top, 110, 60, fill = 1 );
Fill Color( "red" );
Rect( 110, top, right, 60, fill = 1 );
Fill Color( "green" );
Rect( left, 60, 110, bottom, fill = 1 );
Fill Color( "orange" );
Rect( 110, 60, right, bottom, fill = 1 );
)}
)}
)
)
);
但是,有一種更簡單的形式,大多數程序員都覺得更方便
Names Default To Here( 1 );
dt = open("$SAMPLE_DATA/big class.jmp");
gb = dt << Graph Builder(
Size( 528, 456 ),
Show Control Panel( 0 ),
Variables( X( :weight ), Y( :height ) ),
Elements( Points( X, Y, Legend( 5 ) ) )
);
report(gb)[FrameBox(1)] << add graphics script(
Transparency( 0.5 );
Fill Color( {1, 1, .5} );
left = Current Report()[axisbox( 1 )] << getmin;
top = Current Report()[axisbox( 2 )] << getmax;
right = Current Report()[axisbox( 1 )] << getmax;
bottom = Current Report()[axisbox( 2 )] << getmin;
Fill Color( {1, 1, .5} );
Rect( left, top, 110, 60, fill = 1 );
Fill Color( "red" );
Rect( 110, top, right, 60, fill = 1 );
Fill Color( "green" );
Rect( left, 60, 110, bottom, fill = 1 );
Fill Color( "orange" );
Rect( 110, 60, right, bottom, fill = 1 );
);