在 Graph Builder 中创建具有不同汇总统计数据的重复热图给定大类和这个图:
Graph Builder(
Size( 574, 613 ),
Graph Spacing( 20 ),
Variables(
X( :sex ),
X( :sex ),
Y( :age ),
Color( :height, Summary Statistic( "Min" ) )
),
Elements( Position( 1, 1 ), Heatmap( X, Y, Legend( 4 ) ) ),
Elements( Position( 2, 1 ), Heatmap( X, Y, Legend( 5 ) ) )
)
有没有办法让左边的图使用“平均值”汇总统计数据,而右边的图使用“最小值”?
我尝试添加另一个 Color() 规范,但它似乎在 JMP 17 中不起作用。
数据探索与可视化回复:在 Graph Builder 中创建具有不同汇总统计数据的重复热图我所做的是
- 使用表格=>摘要创建一个新表,其中包含按性别和年龄分组的平均值和最小统计数据
- 使用 Tables=>Stack 堆叠平均值和最小值列
- 运行图形生成器

names default to here(1);
dt =
// Open Data Table: Big Class.jmp
// → Data Table( "Big Class" )
Open( "$SAMPLE_DATA/Big Class.jmp" );
// Data table summary
// → Data Table( "Summary of Big Class grouped by age, sex" )
Data Table( "Big Class" ) << Summary(
Group( :age, :sex ),
Mean( :height ),
Min( :height ),
Freq( "None" ),
Weight( "None" ),
statistics column name format( "stat" ),
output table name( "Summary of Big Class grouped by age, sex" )
);
// Stack data table
// → Data Table( "Stack of Summary of Big Class grouped by age, sex (Mean, Min)" )
Data Table( "Summary of Big Class grouped by age, sex" ) <<
Stack(
columns( :Mean, :Min ),
Output Table( "Stack of Summary of Big Class grouped by age, sex (Mean, Min)" )
);
Graph Builder(
X Group Edge( "Bottom" ),
Variables( X( :sex ), Y( :age ), Group X( :Label ), Color( :Data ) ),
Elements( Heatmap( X, Y, Legend( 4 ) ) )
);
回复:在 Graph Builder 中创建具有不同汇总统计数据的重复热图另一个选项是创建两个图表生成器报告并将它们并排放置在自定义报告新窗口中。您可能需要重新命名图表,以便清楚地看到其中一个颜色为最小值和最大值。这是一个简单的例子:
names default to here(1);
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
hm1 = expr( dt << Graph Builder(
Size( 235, 613 ),
Show Control Panel( 0 ),
Variables(
X( :sex ),
Y( :age ),
Color( :height, Summary Statistic( "Min" ) )
),
Elements( Heatmap( X, Y, Legend( 1 ) ) ),
));
hm2 = expr( dt << Graph Builder(
Size( 235, 613 ),
Show Control Panel( 0 ),
Variables(
X( :sex ),
Y( :age ),
Color( :height, Summary Statistic( "Max" ) )
),
Elements( Heatmap( X, Y, Legend( 1 ) ) ),
));
new window( "Two Heat Maps",
h list box( hm1, hm2 )
);
回复:在 Graph Builder 中创建具有不同汇总统计数据的重复热图冒着过度设计这个解决方案的风险,您可以将其概括为统计列表。
names default to here(1);
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
statList = { "Mean", "Median", "Mode", "Min", "Max", "Range", "Median", "Std Dev" };
hm_fxn = function( { STAT },
dt << Graph Builder(
Size( 200, 300 ), // Adjust size based on number of heatmaps
Show Control Panel( 0 ),
Variables(
X( :sex ),
Y( :age ),
Color( :height, Summary Statistic( STAT ) )
),
Elements( Heatmap( X, Y, Legend( 1 ) ) ),
SendToReport(
Dispatch( {}, "Graph Builder", OutlineBox,
{Set Title( "Color by " || STAT ), Image Export Display( Normal )}
)
)
)
);
new window( "Heat Maps",
outline box( dt << get name || " Heat Maps",
lub = line up box( n col( 4 ) ) // Adjust n col() for number of heatmaps per row
)
);
for each( { s }, statList,
lub << append( hm_fxn( s ) )
)

回复:在 Graph Builder 中创建具有不同汇总统计数据的重复热图
@BHarris写道:我尝试添加另一个 Color() 规范,但它似乎在 JMP 17 中不起作用。
-> 添加其他颜色
与 JMP 17 (.2) 配合使用

dt = Open( "$SAMPLE_DATA/Big Class Families.jmp" );
Graph Builder(
Size( 574, 613 ),
Summary Statistic( "Median" ),
Graph Spacing( 20 ),
Variables(
X( :sex ),
X( :sex ),
Y( :age ),
Color( :height, Summary Statistic( "N" ) ),
Color( :height, Summary Statistic( "Max" ) )
),
Elements( Position( 1, 1 ), Heatmap( X, Y, Color( 1 ), Legend( 4 ) ) ),
Elements( Position( 2, 1 ), Heatmap( X, Y, Color( 2 ), Legend( 5 ) ) )
);
回复:在 Graph Builder 中创建具有不同汇总统计数据的重复热图太棒了,成功了!我觉得我在添加颜色规范时遗漏了额外的 X 变量。如果 GB 在 UI 中支持这一点就好了,但它已经做了很多了……
以下是我所寻找的最终脚本:
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
Graph Builder(
Size( 934, 824 ),
Show Title( 1 ),
Graph Spacing( 20 ),
Variables(
X( :sex ),
X( :sex ),
X( :sex ),
Y( :age ),
Color( :height, Summary Statistic( "Min" ) ),
Color( :height, Summary Statistic( "Mean" ) ),
Color( :height, Summary Statistic( "Max" ) )
),
Elements(
Position( 1, 1 ),
Heatmap( X, Y, Color( 1 ), Legend( 1 ), Label( "Label by Value" ) )
),
Elements(
Position( 2, 1 ),
Heatmap( X, Y, Color( 2 ), Legend( 2 ), Label( "Label by Value" ) )
),
Elements(
Position( 3, 1 ),
Heatmap( X, Y, Color( 3 ), Legend( 3 ), Label( "Label by Value" ) )
),
SendToReport(
Dispatch(
{},
"graph title",
TextEditBox,
{Set Text( "Age vs. Sex, Colored on Height -- Min, Mean, Max" )}
),
Dispatch(
{},
"400",
LegendBox,
{Legend Position( {1, [0], 2, [-1], 3, [-1]} )}
)
)
)