cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar
hogi
Level XI

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 has 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 ) )
			)}
		)
	)
)

 

1 ACCEPTED SOLUTION

Accepted Solutions
hogi
Level XI

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

50% of this wish Graph Builder: Line - possibility to add breaks  come too late, option (2) is already available:

hogi_0-1689433692693.png

 

With this new finding, I am happy to present you:

hogi_1-1689433848246.png

version 3:

  • measurements of one group have same color
  • no nasty jumps back for the individual curves
  • transparency works
  • each group has it's own smoother curve
  • smoother curves with matching color
  • new rows added to the data table *)

*) Definitely: a slight tendency towards a "workaround" - it only works because auxiliary rows were added to the data table **)
But after all, it was a GraphBuilder feature which made it work

What do you think, does it count?

 

**) With one of these new features:Graph Builder - Overlay by multiple columns ,Graph Builder: Line - possibility to add breaks[option (1)] you will get the same graph just using Graph Builder ... without the need for data table modifications.

 

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

//version 3
stations = dt << Summary(Group( :STATION, :NAME ));
For EACH({station}, stations[0,0], dt << add row({:STATION=station[1],:NAME=station[2]})); 
dt << sort( BY(:NAME, :DATE ), Replace Table);

dt << Graph Builder(
	Variables( X( :DATE ), Y( :TAVG ), Overlay( :group ), Color( :group ) ),
	Elements(
		Line( X, Y, Legend( 1 ), Row order( 1 ), Missing Values( "No Connection" ) ),
		Smoother( X, Y, Color( 0 ), Legend( 2 ) )
	),
	SendToReport(
		Dispatch(
			{},
			"400",
			ScaleBox,
			{Legend Model(
				1,
				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 ) )
			), Legend Model(
				2,
				Base( 0, 0, 0, Item ID( "2", 1 ) ),
				Base( 1, 0, 0, Item ID( "3", 1 ) ),
				Base( 2, 0, 0, Item ID( "4", 1 ) )
			)}
		)
	)
)

 

#1000

View solution in original post

5 REPLIES 5
jthi
Super User

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

Try removing group from color for smoother and to remove zigzag disable Row order

jthi_0-1689326214527.png

 

-Jarmo
hogi
Level XI

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

nice trick

I thought: the group is already used for color, what can I do more than that ?
- I didn't expect that this is already too much

already close to where we want to get ...

 

version 2 (b):

  • measurements of one group have same color
  • nasty jumps back for the individual curves (fixed by removing row order)
    unfortunately not anymore: one curve per measurement
  • transparency works
  • each group has it's own smoother curve
  • smoother curves with matching color 

hogi_2-1689326899601.png

 

 

 



hogi
Level XI

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

I hope somebody finds a way to get this graph created in Jmp (17)  - without adding new rows and columns to the graph.

 

The option to Overlay by multiple column could be an easy way to solve the problem.

 

In addition, here is another wish (actually 2 options) Graph Builder: Line - possibility to add breaks how Graph Builder could be enabled to generate such plots.

hogi
Level XI

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

50% of this wish Graph Builder: Line - possibility to add breaks  come too late, option (2) is already available:

hogi_0-1689433692693.png

 

With this new finding, I am happy to present you:

hogi_1-1689433848246.png

version 3:

  • measurements of one group have same color
  • no nasty jumps back for the individual curves
  • transparency works
  • each group has it's own smoother curve
  • smoother curves with matching color
  • new rows added to the data table *)

*) Definitely: a slight tendency towards a "workaround" - it only works because auxiliary rows were added to the data table **)
But after all, it was a GraphBuilder feature which made it work

What do you think, does it count?

 

**) With one of these new features:Graph Builder - Overlay by multiple columns ,Graph Builder: Line - possibility to add breaks[option (1)] you will get the same graph just using Graph Builder ... without the need for data table modifications.

 

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

//version 3
stations = dt << Summary(Group( :STATION, :NAME ));
For EACH({station}, stations[0,0], dt << add row({:STATION=station[1],:NAME=station[2]})); 
dt << sort( BY(:NAME, :DATE ), Replace Table);

dt << Graph Builder(
	Variables( X( :DATE ), Y( :TAVG ), Overlay( :group ), Color( :group ) ),
	Elements(
		Line( X, Y, Legend( 1 ), Row order( 1 ), Missing Values( "No Connection" ) ),
		Smoother( X, Y, Color( 0 ), Legend( 2 ) )
	),
	SendToReport(
		Dispatch(
			{},
			"400",
			ScaleBox,
			{Legend Model(
				1,
				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 ) )
			), Legend Model(
				2,
				Base( 0, 0, 0, Item ID( "2", 1 ) ),
				Base( 1, 0, 0, Item ID( "3", 1 ) ),
				Base( 2, 0, 0, Item ID( "4", 1 ) )
			)}
		)
	)
)

 

#1000

hogi
Level XI

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

@XanGregg , will Overlay Encoding facilitate the creation of such plots (different color and individual fit curves for different variants - but more than one measurement curve per variant).