cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
New to using JMP? Hit the ground running with the Early User Edition of Discovery Summit. Register now, free of charge.
Register for our Discovery Summit 2024 conference, Oct. 21-24, where you’ll learn, connect, and be inspired.
Choose Language Hide Translation Bar
mvanderaa1
Level IV

How to get the life distribution platform to use the colors defined in the row states?

In analysis platforms I expected the graph colors to match with what is defined in the row states (if applicable). This does not seem to be the case however. Below example from big class where I applied row state colors based on the Sex variable, and then analyze life distribution grouped by Sex as well. The standard blue and red colors are used instead of the purple and orange in the datatable.

 

mvanderaa1_0-1668594970485.png

The code

dt = Open( "$SAMPLE_DATA\big class.jmp" );
dt << Set Row States(
	[6144, 6144, 6144, 6144, 6144, 1536, 1536, 1536, 6145, 6144, 6144, 1536, 1536, 1536, 1536, 6144, 6144, 6144, 6144, 6144, 1536, 1536, 1536, 1536,
	1536, 1536, 1536, 6144, 6144, 1536, 1536, 1536, 1536, 1536, 6144, 6144, 1536, 6144, 1536, 1536]
);
Life Distribution(
	Perspective( Compare Groups ),
	Y( :height ),
	Grouping( :sex ),
	Confidence Interval Method( Wald ),
	Select Distribution( Distribution, Weibull ),
	Select Scale( Weibull ),
	Tabbed Report( 0 ),

);

 

1 REPLY 1
mvanderaa1
Level IV

Re: How to get the life distribution platform to use the colors defined in the row states?

My current work around for this is to loop the "CustomStream" and the "Marker" segments and takes the color values from the row states. I do really hope there's a better way though.

dt = Open( "$SAMPLE_DATA\big class.jmp" );
dt << Set Row States(
	[6144, 6144, 6144, 6144, 6144, 1536, 1536, 1536, 6145, 6144, 6144, 1536, 1536, 1536, 1536, 6144, 6144, 6144, 6144, 6144, 1536, 1536, 1536, 1536,
	1536, 1536, 1536, 6144, 6144, 1536, 1536, 1536, 1536, 1536, 6144, 6144, 1536, 6144, 1536, 1536]
);

//dt = Current Data Table();
dtsum = dt << Summary( Group( :Sex));
cc = dtsum << get row states();
Close( dtsum, NoSave );
platform = Life Distribution(
	Perspective( Compare Groups ),
	Y( :height ),
	Grouping( :sex ),
	Confidence Interval Method( Wald ),
	Select Distribution( Distribution, Weibull ),
	Select Scale( Weibull ),
	Tabbed Report( 0 ),

);

reportWindow = platform << Report;
customSegs = reportWindow["Compare Distribution"]<< Xpath( "//CustomStreamSeg" );
markerSegs = reportWindow["Compare Distribution"]<< Xpath( "//MarkerSeg" );
For( i = 1, i <= N Items( customSegs ), i++,
	customSegs[i] << {Fill Color( Color Of( As Row State( cc[i] ) ) ), Fill( 0 )};
	customSegs[i] << {Line Color( Color Of( As Row State( cc[i] ) ) ), Fill( 0 )};
	markerSegs[2*i-1] << {Color( Color Of( As Row State( cc[i] ) ) )};
);