cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
JMP is taking Discovery online, April 16 and 18. Register today and join us for interactive sessions featuring popular presentation topics, networking, and discussions with the experts.
Choose Language Hide Translation Bar
Craige_Hales
Super User
Can JSL use custom Heat Colors?

Here's a snippet from a future project.  None of the default color themes do what I want (making numbers at each end black or gray) so I passed a theme definition to heat color for the 2nd argument (instead of the name of a default theme).

 

colors = Heat Color(
	// the first argument is a JSL matrix for efficiency:
	(0 :: 800) / 800, // 800 pixels wide, smoothly interpolated by heatcolor
	// the second argument is a list that specifies the color theme
	{"", // no name or flags needed, just the name placeholder
		{ // this theme uses 12 colors
			RGB Color( 0, 0, 0 ), // black
			HLS Color( 4.0 / 10.0, .3, 1 ), // darken beginning
			HLS Color( 5.0 / 10.0, .5, 1 ), //
			HLS Color( 6.0 / 10.0, .5, 1 ), //
			HLS Color( 7.0 / 10.0, .5, 1 ), //
			HLS Color( 8.0 / 10.0, .5, .7 ), // desaturate magenta
			HLS Color( 9.0 / 10.0, .5, 1 ), //
			HLS Color( 0.0 / 10.0, .5, 1 ), //
			HLS Color( 1.0 / 10.0, .5, 1 ), //
			HLS Color( 2.0 / 10.0, .5, 1 ), //
			HLS Color( 3.0 / 10.0, .3, 1 ), // darken ending
			RGB Color( .5, .5, .5 ) // gray
		}, 
		// this theme positions the 12 colors between 0 and 1, inset from the ends
		As List( (1 :: 12) / 13 )[1] // positions 1/13 ... 12/13
	} 
);

For( i = 1, i <= 8, i++, // double the height several times
	colors = colors |/ colors
);

pic = New Image( colors ); // matrix to image

New Window( "Demo Heat Color", pic ); // display

Showing the wash of color from Left to Right matching the color theme specificationShowing the wash of color from Left to Right matching the color theme specification

Here's another approach.

Last Modified: Jan 3, 2017 10:09 AM