在 BigClass 中寻找外星人的过程中,今天我想生成一个热图来让外星人一目了然。
想法:将非外星人学生涂成绿色,将外星人涂成红色。
但对于几个同年龄段的非外星人来说,外星人的红色只是略微可见:

下一个想法:
让我们增加非外星人的透明度,以便让外星人所在的年龄段变得清晰可见。
我执行这些细胞变红(带有一些绿色的触摸) - 但它们是绿色的,而不是红色的。
似乎透明度没有针对不同颜色单独处理,但是混合的以及然后应用于混合颜色。
所以,5% 绿色 + 100% 红色给出

最后一次尝试:
更改数据类型并使用最大摘要统计:

有时,如果您想聚合,从字符切换到数字会更容易 - 就像这里一样。
但字符值的聚合也有一些潜力:
摘要和制表:为字符列添加聚合选项
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt << New Column( "alien", Character,nominal, set each value( "-" ) );
dt << add rows( {name = "XX", alien = "alien", sex = "M", age = 15} );
dt << add rows( {name = "YZ", alien = "alien", sex = "F", age = 12} );
dt << add rows( {name = "KR", alien = "alien", sex = "F", age = 17} );
// first attempt
dt << Graph Builder(
Variables( X( :sex ), Y( :age ), Color( :alien ) ),
Elements( Heatmap( X, Y, Legend( 10 ) ) ),
SendToReport(
Dispatch({},"400",ScaleBox,
{Legend Model( 10, Properties( 0, {Fill Color( 36 )}, Item ID( "-", 1 ) ) )}
)
)
);
// second attempt: increase transparency for non-aliens
dt << Graph Builder(
Variables( X( :sex ), Y( :age ), Color( :alien ) ),
Elements( Heatmap( X, Y, Legend( 10 ) ) ),
SendToReport(
Dispatch(
{},
"400",
ScaleBox,
{Legend Model( 10, Properties( 0, {Fill Color( 36 ), Transparency( 0.05 )}, Item ID( "-", 1 ) ) )}
)
)
);
// 3rd attempt: aggregate
Graph Builder(
Variables(
X( :sex ),
Y( :age ),
Color( :alien_num, Summary Statistic( "Max" ) )
),
Elements( Heatmap( X, Y, Legend( 10 ) ) ),
SendToReport(
Dispatch(
{},
"400",
ScaleBox,
{Legend Model(
10,
Properties( 0, {Fill Color( 36 )}, Item ID( "0", 1 ) )
)}
)
)
)