森林圖的條形圖和誤差條顏色?我正在創建森林圖並提出了兩種樣式:

我試圖通過行顏色來控制條形、點和誤差條的顏色:

我的問題是為什麼實心條和誤差條不是所需的顏色?
dt = New Table( "Forest Plot", Add Rows( 5 ),
New Column( "EVENT_NAME", Character( 20 ), "Nominal",
Set Values( {"AAAAAAA", "BBBBBBB", "CCCCCCC", "DDDDDDD", "EEEEEEE"} ) ),
New Column( "DISPROP025", Numeric, "Continuous", Format( "Fixed Dec", 16, 2 ),
Set Values(
[5.3766744840813, 1.28687381477736, 5.96303490967794, 1.55531597890029, 2.34164191312678] ) ),
New Column( "DISPROP", Numeric, "Continuous", Format( "Fixed Dec", 16, 2 ),
Set Values(
[5.76756983251198, 1.49287821887835, 7.02941951612351, 3.83591362397761, 2.62194430908125] ) ),
New Column( "DISPROP975", Numeric, "Continuous", Format( "Fixed Dec", 16, 2 ),
Set Values(
[6.06935482201811, 1.66251397924122, 7.91895228410917, 6.92389142535734, 2.84619058478479] ) ),
New Column( "Alert", Character, "Nominal",
Formula( If( :DISPROP025 > 1 & :DISPROP > 2, "Y", "N" ) ) ),
Set Row States( [13568, 13056, 13568, 13568, 13568] )
);
// Bars + central point
dt << Graph Builder(
Show Control Panel( 0 ),
Variables(
X( :DISPROP025 ),
X( :DISPROP, Position( 1 ) ),
X( :DISPROP975, Position( 1 ) ),
Y( :EVENT_NAME )
),
Elements(
Bar( X( 1 ), X( 3 ), Y, Legend( 9 ), Bar Style( "Range" ) ),
Points( X( 2 ), Y, Legend( 10 ), Jitter( 0 ) )
),
SendToReport(
Dispatch( {}, "DISPROP025", ScaleBox,
{Min( 0 ), Add Ref Line( 1, "Dotted", "Dark Red", "", 2 ),
Label Row( Show Major Grid( 1 ) )}
),
Dispatch( {}, "EVENT_NAME", ScaleBox, {Label Row( Show Major Grid( 1 ) )} ),
Dispatch( {}, "X title", TextEditBox, {Set Text( "Disproportionality" )} ),
Dispatch( {}, "Y title", TextEditBox, {Set Text( "PT" )} )
)
);
// Error bars
dt << Graph Builder(
Show Control Panel( 0 ),
Variables(
X( :DISPROP025 ),
X( :DISPROP, Position( 1 ) ),
X( :DISPROP975, Position( 1 ) ),
Y( :EVENT_NAME )
),
Elements(
Bar( X( 1 ), X( 3 ), Y, Legend( 9 ), Bar Style( "Interval" ) ),
Points( X( 2 ), Y, Legend( 10 ), Jitter( 0 ) )
),
SendToReport(
Dispatch( {}, "DISPROP025", ScaleBox,
{Min( 0 ), Add Ref Line( 1, "Dotted", "Dark Red", "", 2 ),
Label Row( Show Major Grid( 1 ) )}
),
Dispatch( {}, "EVENT_NAME", ScaleBox, {Label Row( Show Major Grid( 1 ) )} ),
Dispatch( {}, "X title", TextEditBox, {Set Text( "Disproportionality" )} ),
Dispatch( {}, "Y title", TextEditBox, {Set Text( "PT" )} )
)
);回复:森林圖的條形圖和誤差條顏色?這是一個“足夠接近政府工作”的聰明解決方案。我將線條加粗到 2 的寬度,輕微的偏移不明顯。謝謝克里斯!
回复:森林圖的條形圖和誤差條顏色?好吧,該死的。另一種方法是將 DISPROP 列堆疊成一個並使值列(在下面的腳本中稱為數據)連續。 然後使用這個腳本
Graph Builder(
Size( 992, 630 ),
Show Control Panel( 0 ),
Variables( X( :Data ), Y( :EVENT_NAME ), Overlay( :Alert ) ),
Elements(
Points(
X,
Y,
Legend( 5 ),
Jitter( 0 ),
Summary Statistic( "Median" ),
Error Bars( "Range" )
)
),
SendToReport(
Dispatch( {}, "Data", ScaleBox, {Label Row( Show Major Grid( 1 ) )} ),
Dispatch( {}, "EVENT_NAME", ScaleBox, {Label Row( Show Major Grid( 1 ) )} )
)
);

它很接近,但是關於網格線和使用覆蓋的數據點仍然有一些偏差
回复:森林圖的條形圖和誤差條顏色?還是沒有喜悅。看起來,當混合使用 Y 和 N 警報時,誤差線會偏離網格線。

這是代碼:
Graph Builder(
Size( 726, 451 ),
Show Control Panel( 0 ),
Show Legend( 0 ),
Variables(
X( :DISPROP025 ),
X( :DISPROP975, Position( 1 ) ),
X( :DISPROP, Position( 1 ) ),
Y( :EVENT_NAME ),
Overlay( :Alert )
),
Elements(
Bar( X( 1 ), X( 2 ), X( 3 ), Y, Legend( 8 ), Bar Style( "Interval" ) )
),
SendToReport(
Dispatch( {}, "DISPROP025", ScaleBox,
{Min( 0 ), Add Ref Line( 1, "Dotted", "Dark Red", "", 1 ),
Label Row( Show Major Grid( 1 ) )}
),
Dispatch( {}, "EVENT_NAME", ScaleBox, {Label Row( Show Major Grid( 1 ) )} ),
Dispatch( {}, "400", ScaleBox,
{Legend Model(
8,
Properties( 0, {Line Color( 51 ), Line Width( 2 )} ),
Properties( 1, {Line Color( 51 ), Marker( "FilledCircle" )} ),
Properties( 2, {Line Color( 53 ), Line Width( 2 )} ),
Properties( 3, {Line Color( 53 ), Marker( "FilledCircle" )} )
)}
)
)
);
回复:森林圖的條形圖和誤差條顏色?使用覆蓋的關鍵是不要添加點圖元素。 單擊頂部的點圖標將其關閉。 然後在左下角的 Bar options/discolsure 框,在變量 DISPROP 旁邊打勾。 點將不會添加到錯誤欄內。
回复:森林圖的條形圖和誤差條顏色?另一個謎題 - 當我將我的 Alert 列拖到 Overlay 角色時,我可以很好地控制顏色。然而,這些點位於水平線上,但誤差線不在。有什麼辦法可以糾正這個問題嗎?如果我將 Alert 拖到 Color 角色上,則不會出現“抖動”,但我無法設置誤差線的顏色。

回复:森林圖的條形圖和誤差條顏色?謝謝克里斯。我搜索了 Forest Plots,但沒有找到 Richard 非常好的插件。我也喜歡您的編碼解決方案。
回复:森林圖的條形圖和誤差條顏色?等等,我找到辦法了。 如果您打開控制面板並轉到底部顯示欄的部分,將會有一個可變部分。 打開它並檢查所有變量。一個點會出現在你想要的地方。 從圖表中刪除點元素。 然後使用 Alert 變量進行疊加。
所以腳本看起來像這樣
Graph Builder(
Size( 606, 564 ),
Variables(
X( :DISPROP025 ),
X( :DISPROP, Position( 1 ) ),
X( :DISPROP975, Position( 1 ) ),
Y( :EVENT_NAME ),
Overlay( :Alert )
),
Elements(
Bar( X( 1 ), X( 3 ), X( 2 ), Y, Legend( 9 ), Bar Style( "Interval" ) )
),
SendToReport(
Dispatch(
{},
"DISPROP025",
ScaleBox,
{Add Ref Line( 1, "Dotted", "Dark Red", "", 2 ),
Label Row( Show Major Grid( 1 ) )}
),
Dispatch( {}, "EVENT_NAME", ScaleBox, {Label Row( Show Major Grid( 1 ) )} ),
Dispatch(
{},
"400",
ScaleBox,
{Legend Model(
9,
Properties( 0, {Line Color( 6 )} ),
Properties( 1, {Marker( "Dot" )} ),
Properties( 2, {Line Color( -5682409 )} ),
Properties( 3, {Marker( "Dot" )} )
)}
),
Dispatch( {}, "X title", TextEditBox, {Set Text( "Disproportionality" )} ),
Dispatch( {}, "Y title", TextEditBox, {Set Text( "PT" )} )
)
);回复:森林圖的條形圖和誤差條顏色?您可能必須使用 Alert 變量來著色。 這適用於條形圖,但不適用於誤差條形圖。誤差條顏色由圖例顏色控制。 不確定如何為不同的錯誤欄編寫不同顏色的腳本。回复:森林圖的條形圖和誤差條顏色?你好,
您看過 Richard Zink 關於森林地塊的插件嗎?
https://community.jmp.com/t5/JMP-Add-Ins/Forest-Plot-Add-In/ta-p/23977
由於插件本質上是一個 zip 文件,您可以將文件擴展名重命名為 .zip 並解壓縮。 在那裡你可以看到他的 JSL,也許可以使用其中的一些。
克里斯