森林图的条形图和误差条颜色?我正在创建森林图并提出了两种样式:

我试图通过行颜色来控制条形、点和误差条的颜色:

我的问题是为什么实心条和误差条不是所需的颜色?
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,也许可以使用其中的一些。
克里斯