축에서 특정 값까지의 기준선부드러운 곡선의 x축에 지정된 일부 값에서 y축의 예측 값을 표시하는 그래프를 스크립팅하려고 합니다. 나는 예측 공식을 도출하고 참조선을 정의하기 위한 관련 값을 얻었습니다. 그러나 이를 효과적으로 전달하려면 기준선이 곡선에서 멈추고 점선으로 표시되는 것이 좋습니다. 위의 이미지는 jsl 스크립팅을 사용하여 갈 수 있었던 한도입니다. 아래는 내가 끝내고 싶은 곳입니다.
감사해요!


Re: 축에서 특정 값까지의 참조선이것은 정말 멋져 보이지만 아마도 현재의 이해 수준보다 약간 높을 것입니다. 나는 당신의 예를 통해 내 방식대로 노력할 것이며 그 과정에서 많은 것을 배울 수 있기를 바랍니다!
Re: 축에서 특정 값까지의 참조선고마워요, 이것이 바로 제가 찾던 것이었습니다!
Re: 축에서 특정 값까지의 참조선아래 코드를 사용하면 입력이 하나만 포함된 저장된 수식 열을 동적으로 프로파일링할 수 있습니다. 'Big Class' 및 4차 모델의 경우 다음을 제공합니다.

다소 테스트되지 않았습니다.
NamesDefaultToHere(1);
// Function to find leaves in formula that are columns in the table
// See: https://community.jmp.com/blogs/Uncharted/2015/04/03/head-arg-recurse-formula"
// Thanks to Craige Hales
findColumns =
Function( {frm, cols},
{h = Head( frm ), n = N Arg( frm ), i, result = {}}, // local variables
If( n == 0, // head node has no children, it is a leaf
If( Contains( cols, Name Expr( h ) ), // is the leaf in the list of columns?
Insert Into( result, Name Expr( h ) ); // yes -> add to result
)
,
For( i = 1, i <= n, i++, // not a leaf, get children's results
Insert Into( result, Recurse( Arg( frm, i ), cols ) )
)
);
result; // return the result
);
// Open a table to play with, and add a formula column to it
dt = Open("$SAMPLE_DATA/Big Class.jmp");
fCol = dt << New Column( "Predicted weight",
Formula(-127 + 4 * :height),
Set Property("Predicting", {:weight, Creator( "Bivariate" ), Model Name( "Polynomial Fit Degree=3" )})
);
// Recover the required information
f = fCol << getFormula;
xColList = findColumns(NameExpr(f), dt << getColumnNames);
yCol = fCol << getProperty("Predicting");
yCol = yCol[1];
// Subsequent code will only work with one x Column
xCol = Expr(xColList[1]);
for(c=1, c<=NItems(xColList), c++, Print(c); if(xColList[c] != xCol, Print("Only one x Column allowed."); Beep(); Throw()));
// Reparameterise the formula for later use in the 'GraphBox()'
SubstituteInto(f, xCol, Expr(x));
// Set the initial 'VLine()' value to the mean of the x values
xVals = xCol << getValues;
x = Mean(xVals);
// Get 'reasonable' ranges for the axes
xMin = Min(xVals);
xMax = Max(xVals);
yMin = Min(yCol << getValues);
yMax = Max(yCol << getValues);
// Get the names of the columns involved
xColName = xCol << getName;
yColName = yCol << getName;
// Plot the graph
NewWindow("Function Profile",
gb = GraphBox("Simple Profiler", XScale(xMin, xMax), YScale(yMin, yMax), XName(xColName), yName(yColName),
// Plot the function
PenColor("Red"); YFunction(f, x);
// Handle to drag the 'VLine()' and update display
Handle(x, yMin + (yMax-yMin)/10, gb << reShow, Empty());
// Get the function value for the current x value
yy = Eval(Substitute(NameExpr(f), Expr(x), x));
// Plot the lines at the new places
PenColor("Blue"); LineStyle("Dotted");
VLine(x, yMin, yy);
HLine(xMin, x, yy);
);
);Re: 축에서 특정 값까지의 참조선다음에 추가 @MikeD_앤더슨 , 플랫폼에서 차트에 그래픽을 추가하기 위한 코드를 개발하는 가장 쉬운 방법은 해당 그래프를 마우스 오른쪽 버튼으로 클릭하고 "사용자 정의"를 선택하는 것입니다.이를 통해 실시간으로 그래프를 수정하고 추가할 수 있습니다.그런 다음 "+"를 클릭하고 새 세그먼트를 추가하면 됩니다.

템플릿 또는 샘플 사용 또는 스크립팅 편집기의 "그래픽 범주" 사용

원하는 것을 얻을 때까지 디스플레이를 가지고 놀 수 있습니다.

빨간색 삼각형으로 이동하여 스크립트를 저장할 수 있습니다.

그러면 스크립트를 일반화하기 위해 수정할 수 있는 샘플 스크립트가 제공됩니다.
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA\big class.jmp" );
Bivariate(
Y( :height ),
X( :age ),
Fit Polynomial( 2, {Line Color( {213, 72, 87} )} ),
SendToReport(
Dispatch(
{},
"Bivar Plot",
FrameBox,
{Add Graphics Script(
2,
Description( "Script" ),
Line Style( dashed );
Line( [0, 13.35, 13.35], [62, 62, 50] );
), Grid Line Order( 1 ), Reference Line Order( 3 )}
)
)
);
Re: 축에서 특정 값까지의 참조선축에서 두 개의 참조선을 사용하는 대신 그래픽 스크립트를 사용하여 그래프 상자에 직사각형을 그려보세요.
Names Default To Here( 1 );
New Window( "Example",
Graph Box(
// line color
Pen Color( "Green" );
// line width
Pen Size( 2 );
// line style (dashed)
Line Style (2);
Fill Color( "Red" );
// filled rectangle
Rect( 15, 75, 65, 55, 1 );
// unfilled rectangle (reference lines)
Rect( -1, 80, 70, -1 );
)
);
중