cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Discussions

Solve problems, and share tips and tricks with other JMP users.
%3CLINGO-SUB%20id%3D%22lingo-sub-77733%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3EDiagrammersteller%20mit%20Werten%2C%20die%20nicht%20in%20der%20Datentabelle%20enthalten%20sind%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-77733%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EHallo%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIch%20versuche%2C%20mein%20Skript%20dazu%20zu%20bringen%2C%20Werte%20grafisch%20darzustellen%2C%20die%20nicht%20in%20einer%20Datentabelle%20enthalten%20sind%2C%20aber%20generiert%20werden%2C%20wenn%20das%20Skript%20ausgef%C3%BChrt%20wird.%20Das%20Programm%20beginnt%20mit%20einem%20Datenimport%20in%20zwei%20Spalten%20%C3%A4hnlich%20dieser%3A%3C%2FP%3E%3CTABLE%3E%3CTBODY%3E%3CTR%3E%3CTD%3EPosition%3C%2FTD%3E%3CTD%3EFocusMetric%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%3E0%3C%2FTD%3E%3CTD%3E120%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%3E-4%3C%2FTD%3E%3CTD%3E140%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%3E-8%3C%2FTD%3E%3CTD%3E165%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%3E-4%3C%2FTD%3E%3CTD%3E160%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%3E-0%3C%2FTD%3E%3CTD%3E130%3C%2FTD%3E%3C%2FTR%3E%3C%2FTBODY%3E%3C%2FTABLE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EDann%20passe%20ich%20einen%20Spline%20nach%20oben%2Funten%20an%20den%20Daten%20an%20und%20bestimme%20den%20Versatz%20zwischen%20den%20beiden.%20Das%20Problem%20tritt%20auf%2C%20wenn%20ich%20versuche%2C%20die%20Daten%20grafisch%20darzustellen.%20Der%20GraphBuilder%20findet%20die%20Variablen%20nicht%2C%20da%20sie%20nicht%20in%20der%20Datentabelle%20enthalten%20sind.%20Hier%20ist%20mein%20Code%2C%20bis%20GraphBuilder%20scheint%20alles%20zu%20funktionieren.%20Ich%20versuche%2C%20ein%20Liniendiagramm%20mit%20Offset%2C%20splineEval%20und%20einer%20Markierung%20f%C3%BCr%20das%20Spiel%2C%20splineMin%2C%20zu%20erhalten.%20Alle%20anderen%20Vorschl%C3%A4ge%20sind%20willkommen%2C%20das%20ist%20eine%20neue%20Sprache%20f%C3%BCr%20mich!%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3E%2F%2FSetup%20arrays%20for%20creating%20spline%20over%20data%0Ax%20%3D%20Index(-100%2C0%2C1)%3B%0Aoffset%20%3D%20Index(-20%2C20%2C0.1)%3B%0A%0A%2F%2FDetermine%20position%20minimum%20index%0ArPosMin%20%3D%20dt%20%26lt%3B%26lt%3B%20GetRowsWhere(%3APosition%20%3D%3D%20ColMin(%3APosition))%3B%0A%0A%2F%2FCreate%20spline%20coeficients%20over%20up%2Fdown%20scan%20of%20data%0AsplineUp%20%3D%20SplineCoef(%3APosition%5B1%3A%3ArPosMin-1%5D%2C%20%3AFocusMetric%5B1%3A%3ArPosMin-1%5D%2C%201)%3B%0AsplineDown%20%3D%20SplineCoef(%3APosition%5BrPosMin%2B1%3A%3ANRow()%5D%2C%20%3AFocusMetric%5BrPosMin%2B1%3A%3ANRow()%5D%2C%201)%3B%0A%0A%2F%2FCreate%20array%20of%20least%20squares%0Afor(%20i%3D1%2C%20i%26lt%3B%3Dlength(offset)%2C%20i%2B%2B%2C%0A%20s%5Bi%5D%20%3D%20Sum(Abs(SplineEval(x%2CsplineDown)%20-%20SplineEval((x-offset%5Bi%5D)%2CsplineUp)))%2C%0A)%3B%0A%0A%2F%2FCreate%20spline%20coefficient%20over%20regressed%20data%0Asi%20%3D%20SplineCoef(offset%2Cs%2C1)%3B%0A%0A%2F%2FFind%20minimum%20from%20regressed%20data%20and%20determine%20backlash%0ArSplineMin%20%3D%20Loc(SplineEval(offset%2Csi)%20%3D%3D%20Minimum(SplineEval(offset%2Csi)))%3B%0Abacklash%20%3D%20offset%5BrSplineMin%5D%3B%0Aprint(backlash)%3B%0A%0A%0AGraphBuilder(%0A%20ShowControlPanel(0)%2C%0A%20Variables(%0A%20%20X(offset)%2C%0A%20%20X(backlash%2C%20Position(1))%2C%0A%20%20Y(Values(SplineEval(offset%2Csi)))%2C%0A%20%20Y(rSplineMin%2C%20Position(1))%0A%20)%2C%0A%20Elements(Line(X(1)%2C%20X(2)%2C%20Y(1)%2C%20Y(2)%2C%20Legend(5)))%0A)%3B%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-77939%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3EBetreff%3A%20Diagrammersteller%20mit%20Werten%2C%20die%20nicht%20in%20der%20Datentabelle%20enthalten%20sind%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-77939%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EDas%20funktioniert.%20Vielen%20Dank%20f%C3%BCr%20Ihre%20Hilfe!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-77938%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3EBetreff%3A%20Diagrammersteller%20mit%20Werten%2C%20die%20nicht%20in%20der%20Datentabelle%20enthalten%20sind%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-77938%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EIch%20denke%2C%20es%20w%C3%A4re%20einfacher%2C%20die%20Mindestwerte%20als%20Zeile%20in%20die%20Tabelle%20einzuf%C3%BCgen.%20Die%20Spline-Punkte%20h%C3%A4tten%20den%20Wert%20%E2%80%9ESpline%E2%80%9C%20und%20der%20zus%C3%A4tzliche%20Punkt%20den%20Wert%20%E2%80%9EBacklash%E2%80%9C%20und%20w%C3%BCrden%20ihn%20dann%20als%20einen%20speziellen%20Typ%20eines%20GraphBuilder-Elements%20bezeichnen.Diese%20Kurve%20sieht%20m%C3%B6glicherweise%20seltsam%20aus%2C%20da%20sie%20Ihre%20Beispieldaten%20verwendet.Das%20Skript%20ist%20beigef%C3%BCgt.%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22image.png%22%20style%3D%22width%3A%20559px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22image.png%22%20style%3D%22width%3A%20559px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22image.png%22%20style%3D%22width%3A%20559px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F12693iED00908E632D0D74%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22image.png%22%20alt%3D%22image.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-77915%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3EBetreff%3A%20Diagrammersteller%20mit%20Werten%2C%20die%20nicht%20in%20der%20Datentabelle%20enthalten%20sind%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-77915%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EOK%2C%20das%20kann%20ich%20machen.Wenn%20ich%20sie%20in%20einer%20Datentabelle%20habe%2C%20ist%20es%20dann%20m%C3%B6glich%2C%20einen%20Punkt%20als%20Markierung%20auszuw%C3%A4hlen%2C%20ohne%20f%C3%BCr%20jeden%20einzelnen%20Punkt%20eine%20neue%20Spalte%20erstellen%20zu%20m%C3%BCssen%3F%20Ich%20versuche%2C%20eine%20Markierung%20auf%20den%20Mindestpunkt%20zu%20setzen%2C%20aber%20wenn%20ich%20versuche%2C%20X%2CY%20in%20GraphBuilder%20auf%20diesen%20Index%20zu%20setzen%2C%20erhalte%20ich%20die%20Fehlermeldung%20%E2%80%9EAngegebene%20Spalte%20nicht%20in%20Datentabelle%20gefunden%E2%80%9C.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3EGraphBuilder(%0A%20ShowControlPanel(0)%2C%0A%20Variables(%0A%20%20X(%3Axoff)%2C%0A%20%20X(%3Axoff%5BrSplineMin%5D%2C%20Position(1))%2C%0A%20%20Y(%3Aspline)%2C%0A%20%20Y(%3Aspline%5BrSplineMin%5D%2C%20Position(1))%0A%20%20%0A%20)%2C%0A%20Elements(Line(X(1)%2C%20X(2)%2C%20Y(1)%20Y(2)%2C%20Legend(3)))%2C%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3EWie%20w%C3%BCrde%20ich%20bei%20der%20Skripterstellung%20vorgehen%2C%20um%20diesen%20einzelnen%20Punkt%20auszuw%C3%A4hlen%20und%20dort%20eine%20Markierung%20zu%20platzieren%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-77860%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3EBetreff%3A%20Diagrammersteller%20mit%20Werten%2C%20die%20nicht%20in%20der%20Datentabelle%20enthalten%20sind%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-77860%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EJMP%20Analysis-%20und%20Grpah-Plattformen%20erfordern%20Spalten%20aus%20einer%20Referenztabelle.%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EErstellen%20Sie%20eine%20Tabelle%20aus%20den%20berechneten%2C%20Offset-%2C%20Spiel-%20usw.%20Matrixwerten%20und%20definieren%20Sie%20dann%20GraphBuilder%20mithilfe%20dieser%20neuen%20Tabelle.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Choose Language Hide Translation Bar
JeffG
Level II

Graph builder with values not in data table

Hello,

 

I am trying to get my script to graph values that are not in a data table but are generated when the script is executed. The program starts with an import of data in two columns similar to this:

PositionFocusMetric
0120
-4140
-8165
-4160
-0130

 

I then fit a spline up/down the data and determine the offset between the two. The issue comes when I am trying to graph the data. The GraphBuilder doesn't find the variables because they are not in the datatable. Here is my code, everthing seems to work until GraphBuilder. I am trying to get a line graph of offset,splineEval, and a marker for the backlash,splineMin. Any other suggestions are appreciated, this is a new language for me! 

 

//Setup arrays for creating spline over data
x = Index(-100,0,1);
offset = Index(-20,20,0.1);

//Determine position minimum index
rPosMin = dt << GetRowsWhere(:Position == ColMin(:Position));

//Create spline coeficients over up/down scan of data
splineUp = SplineCoef(:Position[1::rPosMin-1], :FocusMetric[1::rPosMin-1], 1);
splineDown = SplineCoef(:Position[rPosMin+1::NRow()], :FocusMetric[rPosMin+1::NRow()], 1);

//Create array of least squares
for( i=1, i<=length(offset), i++,
	s[i] = Sum(Abs(SplineEval(x,splineDown) - SplineEval((x-offset[i]),splineUp))),
);

//Create spline coefficient over regressed data
si = SplineCoef(offset,s,1);

//Find minimum from regressed data and determine backlash
rSplineMin = Loc(SplineEval(offset,si) == Minimum(SplineEval(offset,si)));
backlash = offset[rSplineMin];
print(backlash);


GraphBuilder(
	ShowControlPanel(0),
	Variables(
		X(offset),
		X(backlash, Position(1)),
		Y(Values(SplineEval(offset,si))),
		Y(rSplineMin, Position(1))
	),
	Elements(Line(X(1), X(2), Y(1), Y(2), Legend(5)))
);
1 ACCEPTED SOLUTION

Accepted Solutions
gzmorgan0
Super User (Alumni)

Re: Graph builder with values not in data table

JMP Analysis and Grpah platforms require a columns from a reference table.  

 

Create a table from the calculated, offset, backlash, etc. matrix values, then define GraphBuilder using this new table.

View solution in original post

4 REPLIES 4
gzmorgan0
Super User (Alumni)

Re: Graph builder with values not in data table

JMP Analysis and Grpah platforms require a columns from a reference table.  

 

Create a table from the calculated, offset, backlash, etc. matrix values, then define GraphBuilder using this new table.

JeffG
Level II

Re: Graph builder with values not in data table

Ok I can do that. Once I have them in a datatable is it possible to select one point to make as a marker without having to create a new column for every individual point? I'm trying to put a marker on the minimum point but when I try to set X,Y in GraphBuilder at that index, I get the error "Specified column not found in data table"

 

GraphBuilder(
	ShowControlPanel(0),
	Variables(
		X(:xoff),
		X(:xoff[rSplineMin], Position(1)),
		Y(:spline),
		Y(:spline[rSplineMin], Position(1))
		
	),
	Elements(Line(X(1), X(2), Y(1) Y(2), Legend(3))),

How would I go about scripting to select that single point and put a marker there? 

gzmorgan0
Super User (Alumni)

Re: Graph builder with values not in data table

I think it would be easier to add the minimum values as a row in the table. The spline points would have a Value of Spline and the extra point a Value of Backlash, then call it out as a special type of  GraphBuilder element.  This curve might look strange because it uses your example data.  The script is attached.

image.png

JeffG
Level II

Re: Graph builder with values not in data table

That works. Thanks for your help!

Recommended Articles