<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Heatmap Plot - mixing colors in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Heatmap-Plot-mixing-colors/m-p/659599#M84886</link>
    <description>&lt;P&gt;In my search for aliens in BigClass, today I want to&amp;nbsp;generate a heatmap plot to show the aliens at a glance.&lt;/P&gt;&lt;P&gt;The idea: color the non-alien students green and the aliens red.&lt;/P&gt;&lt;P&gt;But with several non-aliens in the same age group, the alien red is just slightly visible:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="hogi_3-1689680051325.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/54845i7299D74F0C0D3773/image-size/medium?v=v2&amp;amp;px=400" role="button" title="hogi_3-1689680051325.png" alt="hogi_3-1689680051325.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Next idea:&lt;BR /&gt;Let's increase the transparency for non-aliens such that age groups with aliens inside get nicely visible.&lt;BR /&gt;I exected such cells to get red (with some greenish touch) - but they are quite green, not red.&lt;BR /&gt;Seems that transparency is not treated separately for different colors, but&amp;nbsp;&lt;STRONG&gt;mixed&lt;/STRONG&gt;&amp;nbsp;as well and then applied to the mixed color.&lt;/P&gt;&lt;P&gt;So, 5% green + 100% red gives&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="hogi_2-1689680046296.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/54844iF88EFB04E361276B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="hogi_2-1689680046296.png" alt="hogi_2-1689680046296.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;last attempt:&lt;BR /&gt;change the data type and use Max summary Statistics:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="hogi_4-1689680624330.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/54846i9651105DB79ED68D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="hogi_4-1689680624330.png" alt="hogi_4-1689680624330.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Sometimes it's easier to switch from character to numbers, if you want to aggregate - like here.&lt;BR /&gt;But aggregation of character values has also some potential:&lt;/P&gt;&lt;P&gt;&lt;LI-MESSAGE title="Summary and Tabulate: add aggregation option for Character columns" uid="659314" url="https://community.jmp.com/t5/JMP-Wish-List/Summary-and-Tabulate-add-aggregation-option-for-Character/m-p/659314#U659314" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-idea-thread lia-fa-icon lia-fa-idea lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt &amp;lt;&amp;lt; New Column( "alien", Character,nominal, set each value( "-" ) );
dt &amp;lt;&amp;lt; add rows( {name = "XX", alien = "alien", sex = "M", age = 15} );
dt &amp;lt;&amp;lt; add rows( {name = "YZ", alien = "alien", sex = "F", age = 12} );
dt &amp;lt;&amp;lt; add rows( {name = "KR", alien = "alien", sex = "F", age = 17} );


// first attempt
dt &amp;lt;&amp;lt; 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 &amp;lt;&amp;lt; 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 ) )
			)}
		)
	)
)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 18 Jul 2023 11:48:20 GMT</pubDate>
    <dc:creator>hogi</dc:creator>
    <dc:date>2023-07-18T11:48:20Z</dc:date>
    <item>
      <title>Heatmap Plot - mixing colors</title>
      <link>https://community.jmp.com/t5/Discussions/Heatmap-Plot-mixing-colors/m-p/659599#M84886</link>
      <description>&lt;P&gt;In my search for aliens in BigClass, today I want to&amp;nbsp;generate a heatmap plot to show the aliens at a glance.&lt;/P&gt;&lt;P&gt;The idea: color the non-alien students green and the aliens red.&lt;/P&gt;&lt;P&gt;But with several non-aliens in the same age group, the alien red is just slightly visible:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="hogi_3-1689680051325.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/54845i7299D74F0C0D3773/image-size/medium?v=v2&amp;amp;px=400" role="button" title="hogi_3-1689680051325.png" alt="hogi_3-1689680051325.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Next idea:&lt;BR /&gt;Let's increase the transparency for non-aliens such that age groups with aliens inside get nicely visible.&lt;BR /&gt;I exected such cells to get red (with some greenish touch) - but they are quite green, not red.&lt;BR /&gt;Seems that transparency is not treated separately for different colors, but&amp;nbsp;&lt;STRONG&gt;mixed&lt;/STRONG&gt;&amp;nbsp;as well and then applied to the mixed color.&lt;/P&gt;&lt;P&gt;So, 5% green + 100% red gives&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="hogi_2-1689680046296.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/54844iF88EFB04E361276B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="hogi_2-1689680046296.png" alt="hogi_2-1689680046296.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;last attempt:&lt;BR /&gt;change the data type and use Max summary Statistics:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="hogi_4-1689680624330.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/54846i9651105DB79ED68D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="hogi_4-1689680624330.png" alt="hogi_4-1689680624330.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Sometimes it's easier to switch from character to numbers, if you want to aggregate - like here.&lt;BR /&gt;But aggregation of character values has also some potential:&lt;/P&gt;&lt;P&gt;&lt;LI-MESSAGE title="Summary and Tabulate: add aggregation option for Character columns" uid="659314" url="https://community.jmp.com/t5/JMP-Wish-List/Summary-and-Tabulate-add-aggregation-option-for-Character/m-p/659314#U659314" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-idea-thread lia-fa-icon lia-fa-idea lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt &amp;lt;&amp;lt; New Column( "alien", Character,nominal, set each value( "-" ) );
dt &amp;lt;&amp;lt; add rows( {name = "XX", alien = "alien", sex = "M", age = 15} );
dt &amp;lt;&amp;lt; add rows( {name = "YZ", alien = "alien", sex = "F", age = 12} );
dt &amp;lt;&amp;lt; add rows( {name = "KR", alien = "alien", sex = "F", age = 17} );


// first attempt
dt &amp;lt;&amp;lt; 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 &amp;lt;&amp;lt; 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 ) )
			)}
		)
	)
)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jul 2023 11:48:20 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Heatmap-Plot-mixing-colors/m-p/659599#M84886</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2023-07-18T11:48:20Z</dc:date>
    </item>
  </channel>
</rss>

