cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • JMP 19 is here! See the new features at jmp.com/new.
  • Register to attend Discovery Summit 2025 Online: Early Users Edition, Sept. 24-25.
Choose Language Hide Translation Bar
qunw
Level III

Sankey Plot Color Assignment

Hi JMP Community, 

Do you have any experience assigning the color for all sequences in a Sankey Plot with the SAME color category?   The challenge I encountered was that each sequence had a different color category, making it difficult to track the change of items from sequence 1 to 2... to n with the same color assigned. 

Many thanks!

 

 

13 REPLIES 13
qunw
Level III

Re: Sankey Plot Color Assignment

Truly.  A Sankey plot still would be the best visualization for profile tracking.

hogi
Level XII

Re: Sankey Plot Color Assignment

How about the proposal in Parallel Plot: synchronized axes ?
use same "Y" position to identify the same "value".

This option is already available for columns with modeling type "continuous" (not nominal).

 

One can adjust the line width to get a better looking graph.
Unfortunately, there is no possibility to use the line width to represent the fraction / population.

 

Color can be used to identify another type of information:


inital treatment:

hogi_0-1753805857156.png

number of different treatments:

hogi_1-1753805876053.png

 

dt = New Table( "treatment",
	Add Rows( 9 ),
	New Column( "patient",
		Character,
		Set Values(
			{"V1_0", "V1_1", "V1_2", "V1_3", "V1_4", "V1_5", "V1_6", "V1_7", "V1_8"}
		)
	),
	New Column( "treatment 1",
		//"Nominal",
		Set Values( [1, 1, 1, 2, 2, 2, 3, 3, 3] )
	),
	New Column( "treatment 2",
		//"Nominal",
		Set Values( [1, 2, 3, 1, 2, 3, 1, 2, 3] )
	),
	New Column( "treatment 3",
		//"Nominal",
		Set Values( [1, 1, 2, 1, 2, 3, 3, 3, 3] )
	)
);

//this functionality is only available for scripters.
//via the GUI, a user can create the equation manually dt << New Formula Column( Operation( Category( "Character" ), "Concatenate with Underscore" ), Columns( :treatment 1, :treatment 2, :treatment 3 ) ) << Run Formulas; Graph Builder( Size( 568, 240 ), Show Control Panel( 0 ), Summary Statistic( "Median" ), Graph Spacing( 4 ), Variables( X( :treatment 1 ), X( :treatment 2, Position( 1 ) ), X( :treatment 3, Position( 1 ) ), Color( :"Concatenate[treatment 1,treatment 2,treatment 3]"n ) ), Elements( Parallel( X( 1 ), X( 2 ), X( 3 ) ) ) );

 

qunw
Level III

Re: Sankey Plot Color Assignment

You are absolutely correct!

qunw
Level III

Re: Sankey Plot Color Assignment

Thanks, Victor, for your references!  I used the parallel coordinates plot for the Sankey Plot of the patient treatment profiling, and it's challenging to assign the same colors to the same regimens in the sequence of treatments. The two examples included in the instruction of the parallel plot are not precisely similar to my case, which may need additional coding to help synchronize the color setting across treatments. 

Recommended Articles