cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • New to JMP? Join us Sept. 23-24 for the Early User Edition of Discovery Summit, tailor-made for new users. Register now for free!
  • Use World Cup data to build models, explore spatial relationships, and create informative visualizations in JMP. Register. July 17, 2 pm US Eastern Time.
  • Your voice matters! Tell us how you prefer to receive JMP updates, so we can tailor our communication to your needs. Take short survey.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
hogi
Level XIII

Graph Builder. Combine Smoother and Line - how?

I have groups of measurement that I want to plot "together". 

The individual measurement curves of a group should have the same color and be semi-transparent.
For each group there should be an additional smoother curve with the same color.

 

Is this possible in Jmp? - without "workarounds"?

 

version 1:

  • measurements of one groups have same color
  • one curve per measurement
  • transparency works
  • 1 smoother line instead of 3
  • the smoother curve doesn't have the "right" color [consequential error]

hogi_2-1689325538795.png

version 2:

  • measurements of one groups have same color
  • nasty jumps back for the individual curves
  • transparency works
  • each group has it's own smoother curve
  • smoother curves have the wrong color

 

hogi_1-1689325503986.png

 

 

dt =Open( "$SAMPLE_DATA/Functional Data/Weekly Weather Data.jmp" );
dt << New Column( "group",Character,"Nominal",Formula( Substr( :STATION, 8, 1 ) ));

//version 1
dt << Graph Builder(
	Variables(
		X( :DATE ),
		Y( :TAVG ),
		Overlay( :STATION ),
		Color( :group )
	),
	Elements(
		Line( X, Y, Legend( 31 ) ),
		Smoother( X, Y, Overlay( 0 ), Legend( 32 ) )
	),
	SendToReport(
		Dispatch(
			{},
			"400",
			ScaleBox,
			{Legend Model(
				31,
				Properties( 0, {Transparency( 0.2 )}, Item ID( "2", 1 ) ),
				Properties( 1, {Transparency( 0.2 )}, Item ID( "3", 1 ) ),
				Properties( 2, {Transparency( 0.2 )}, Item ID( "4", 1 ) )
			)}
		)
	)
	
);


//version 2
dt << Graph Builder(
	Variables( X( :DATE ), Y( :TAVG ), Overlay( :group ), Color( :group ) ),
	Elements(
		Line( X, Y, Legend( 31 ), Row order( 1 ) ),
		Smoother( X, Y, Legend( 32 ) )
	),
	SendToReport(
		Dispatch(
			{},
			"400",
			ScaleBox,
			{Legend Model(
				31,
				Properties( 0, {Transparency( 0.2 )}, Item ID( "2", 1 ) ),
				Properties( 1, {Transparency( 0.2 )}, Item ID( "3", 1 ) ),
				Properties( 2, {Transparency( 0.2 )}, Item ID( "4", 1 ) )
			)}
		)
	)
)

 

12 REPLIES 12
hogi
Level XIII

Re: Graph Builder. Combine Smoother and Line - how?

A nice improvement in JMP19 is the Type Properties() feature, which allows us to apply transparency much easier:

hogi_0-1766437141151.png

  • same group = same color
  • transparency via Type Properties - no need to set it manually for every curve.
  • each group has it's own smoother curve (overlay encoding = auto or color)
  • smoother curves with matching color
  • just the zig-zag lines need some extra effort *)

*) and this topic may be addressed in a future version of JMP:
https://community.jmp.com/t5/JMP-Wish-List/Graph-Builder-Line-possibility-to-add-breaks/idc-p/921029... 
cool!

Graph Builder(
	Variables(
		X( :DATE ),
		Y( :TAVG ),
		Overlay( :group, Overlay Encoding( "Color" ) )
	),
	Elements(Smoother( X, Y, Legend( 2 ) ),  Line( X, Y, Legend( 1 ), Ordering( "Row Order" ) ) ),
	SendToReport(
		Dispatch( {}, "400", ScaleBox,
			{Legend Model(
				1,
				Type Properties( 0, "H Line", {Transparency( 0.2 )} )
			)}
		)
	)
);

 

hogi
Level XIII

Re: Graph Builder. Combine Smoother and Line - how?

cool, JMP20 will bring a very easy solution for the issue with the zig-zag lines Yes, stay Tuned!

hogi_0-1771349759556.png

dt =Open( "$SAMPLE_DATA/Functional Data/Weekly Weather Data.jmp" );
dt << New Column( "group",Character,"Nominal",Formula( Substr( :STATION, 8, 1 ) ));
Graph Builder( Variables( X( :DATE ), Y( :TAVG ), Overlay( :group ) ), Elements( Line( X, Y, Ordering( "Row Ascending" ) ), Smoother( X, Y ) ) );

hogi_1-1771349918234.png

hogi
Level XIII

Re: Graph Builder. Combine Smoother and Line - how?

It feels like a game changer for specific types of plots, such as grouped I-V curves.
@isabelleswaenep 

Recommended Articles