cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
%3CLINGO-SUB%20id%3D%22lingo-sub-417822%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3Emake%20Smoother%20in%20Graph%20Builder%20a%20scriptable%20object%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-417822%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EI%20frequently%20save%20the%20spline%20smoother%20formula%20from%20Graph%20Builder%20with%20overlay%20of%20a%20categorical%20variable%20and%20then%20save%20the%20formula%20to%20the%20data%20table%20because%20of%20the%20noise%20in%20my%20data.%20I%20use%20it%20so%20often%20that%20I%20would%20like%20to%20be%20able%20to%20script%20it.%26nbsp%3B%20After%20having%20checked%20the%20section%20of%20the%20Scripting%20Guide%20about%26nbsp%3B%20Executing%20Embedded%20Red%20Triangle%20options%2C%20I%20cannot%20see%20the%20Smoother%20as%20a%20scriptable%20object.%20Please%20make%20saving%20the%20spline%20smoother%20formula%20something%20that%20I%20can%20do%20from%20JSL.%20I%20do%20realize%20that%20it%20is%20possible%20to%20use%20a%20spline%20function%20from%20the%20Bivariate%20platform%20with%20a%20By%20variable.%20I%20do%20like%20the%20default%20spline%20fit%20in%20Graph%20Builder%20better.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-417822%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CLINGO-LABEL%3EAutomation%20and%20Scripting%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-421758%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERe%3A%20make%20Smoother%20in%20Graph%20Builder%20a%20scriptable%20object%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-421758%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EI%20think%20this%20question%20was%20superseded%20by%20your%20related%20question%20that%20I%20answered%2C%20so%20I'll%20post%20the%20same%20JSL%20for%20anyone%20coming%20across%20just%20this%20one.%20Though%20I%20hope%20this%20script%20does%20what%20you%20want%2C%20it's%20still%20true%20that%20there's%20no%20Smoother%20object%20per%20se.%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3Egb%20%3D%20Graph%20Builder(%0A%20Variables(%20X(%20%3Aheight%20)%2C%20Y(%20%3Aweight%20)%20)%2C%0A%20Elements(%20Points(%20X%2C%20Y%2C%20Legend(%202%20)%20)%2C%20Smoother(%20X%2C%20Y%2C%20Legend(%203%20))%20)%0A)%3B%0Agbb%20%3D%20Report(%20gb%20)%5BGraph%20Builder%20Box(%201%20)%5D%3B%0Agbb%20%26lt%3B%26lt%3B%20Update%20Element(%201%2C%201%2C%202%2C%20%7BSave%20Formula%7D%20)%3B%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-421143%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERe%3A%20make%20Smoother%20in%20Graph%20Builder%20a%20scriptable%20object%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-421143%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EAs%20information%2C%20to%20get%20the%20same%20line%20from%20graph%20builder%20in%20Bivariate%2C%20choose%20'Other...'%20under%20the%20Red%20Triangle%20%26gt%3B%20Flexible%20%26gt%3B%20Fit%20Spline%2C%20use%20a%20lamda%20of%200.05%20(default%20in%20graph%20builder)%20and%20check%20'Standardize%20X'.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22ih_0-1632684190309.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22ih_0-1632684190309.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22ih_0-1632684190309.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F36074iC8A507636510DC29%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22ih_0-1632684190309.png%22%20alt%3D%22ih_0-1632684190309.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Choose Language Hide Translation Bar

make Smoother in Graph Builder a scriptable object

I frequently save the spline smoother formula from Graph Builder with overlay of a categorical variable and then save the formula to the data table because of the noise in my data. I use it so often that I would like to be able to script it.  After having checked the section of the Scripting Guide about  Executing Embedded Red Triangle options, I cannot see the Smoother as a scriptable object. Please make saving the spline smoother formula something that I can do from JSL. I do realize that it is possible to use a spline function from the Bivariate platform with a By variable. I do like the default spline fit in Graph Builder better.

2 Comments
ih
Super User (Alumni)
Super User (Alumni)

As information, to get the same line from graph builder in Bivariate, choose 'Other...' under the Red Triangle > Flexible > Fit Spline, use a lamda of 0.05 (default in graph builder) and check 'Standardize X'.

 

ih_0-1632684190309.png

 

 

XanGregg
Staff

I think this question was superseded by your related question that I answered, so I'll post the same JSL for anyone coming across just this one. Though I hope this script does what you want, it's still true that there's no Smoother object per se.

gb = Graph Builder(
	Variables( X( :height ), Y( :weight ) ),
	Elements( Points( X, Y, Legend( 2 ) ), Smoother( X, Y, Legend( 3 )) )
);
gbb = Report( gb )[Graph Builder Box( 1 )];
gbb << Update Element( 1, 1, 2, {Save Formula} );