你好,
能夠用顏色標記圖表的某些部分很有趣。
您是否有機會無需編寫腳本即可做到這一點?
我只部分使用了重疊的參考線(我想避免) - 請參閱隨附的螢幕截圖。
祝你今天過得愉快。
您可以透過多種方式將項目新增至圖表。
註解
JMP 顯示視窗上方的工具列包含一些允許向圖形添加註釋項目的圖標

可以添加文字、箭頭和直線、多邊形和圓形。它們被添加到圖形顯示的頂部。
您還可以右鍵單擊圖形並選擇“自訂”,這允許使用圖形基元添加項目。雖然它們使用 JSL,但它們使用起來非常簡單,並且允許您添加彩色區域、文字、線條等,並且它們可以放置在顯示器的任何層級。
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 );
);