使用 JSL 改變區域的透明度你好,
我正在使用分組變數擬合模型,並將預測公式和區間公式儲存到我的表格中。然後,我將原始 Y 值、預測 Y 值和 LCL/UCL 放在 Y 軸上,並使用 Wrap 功能建立包含分組變數的圖表(範例程式碼見下文)。
我想要透過腳本將區域的透明度設定為特定數值。我知道可以在圖例中右鍵單擊進行更改,但這需要一個需要用戶輸入的腳本,所以我不能使用常規的“發送到報表”和“分發”功能來靜態地調用列。
<BR />Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Diamonds Data.jmp" );
mod = Fit Model(
Y( :Price ),
By( :Color ),
Effects( :Depth ),
Personality( "Standard Least Squares" ),
Emphasis( "Effect Screening" ),
Run(
:Price << {Summary of Fit( 0 ), Analysis of Variance( 0 ), Parameter Estimates( 1 ),
Sorted Estimates( 0 ), Plot Actual by Predicted( 1 ), Plot Regression( 0 ),
Plot Residual by Predicted( 1 )}
)
);
mod << prediction and interval formulas;
Graph Builder(
Size( 1163, 748 ),
Show Control Panel( 0 ),
Show Legend( 0 ),
Variables(
X( :Depth ),
Y( :Price ),
Y( :Pred Formula Price By Color, Position( 1 ) ),
Y( :Lower 95% Mean Price By Color, Position( 1 ) ),
Y( :Upper 95% Mean Price By Color, Position( 1 ) ),
Wrap( :Color ),
Overlay( :Color )
),
Elements(
Points( X, Y( 1 ), Legend( 7 ) ),
Line( X, Y( 2 ), Legend( 9 ) ),
Area( X, Y( 3 ), Y( 4 ), Legend( 10 ), Area Style( "Range" ), Transparency(0.25) )
)
);
自動化和腳本編寫回覆:使用 JSL 變更區域透明度您可以尋找多邊形段,然後設定它們的透明度。
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Diamonds Data.jmp");
mod = dt << Fit Model(
Y(:Price),
By(:Color),
Effects(:Depth),
Personality("Standard Least Squares"),
Emphasis("Effect Screening"),
Run(
:Price << {Summary of Fit(0), Analysis of Variance(0), Parameter Estimates(1),
Sorted Estimates(0), Plot Actual by Predicted(1), Plot Regression(0),
Plot Residual by Predicted(1)}
)
);
mod << prediction and interval formulas;
gb = dt << Graph Builder(
Size(1163, 748),
Show Control Panel(0),
Show Legend(0),
Variables(
X(:Depth),
Y(:Price),
Y(:Pred Formula Price By Color, Position(1)),
Y(:Lower 95% Mean Price By Color, Position(1)),
Y(:Upper 95% Mean Price By Color, Position(1)),
Wrap(:Color),
Overlay(:Color)
),
Elements(
Points(X, Y(1), Legend(7)),
Line(X, Y(2), Legend(9)),
Area(X, Y(3), Y(4), Legend(10), Area Style("Range"))
)
);
fbs = Report(gb) << XPath("//FrameBox");
For Each({fb}, fbs,
ps = fb << Find Seg(PolySeg(1));
If(!IsEmpty(ps),
ps << Transparency(0.25);
);
);