結合解決方案我和@txnelson前面提供了你應該可以修改point/smoother等等。 首先使用 JMP 創建圖形(不需要所有列都在 y 軸上,您可以只使用兩個)。 我將介紹如何開發此腳本的過程(這會有點長):
1. 打開 JMP 樣本數據。 在這種情況下,據我所知,Semiconductor Capability.jmp 有很多列
2. 在圖形構建器中創建一個圖形,其中一些列作為 X 軸,兩列作為 Y 軸

拿劇本
Graph Builder(
Variables(X(:lot_id), Y(:NPN1), Y(:PNP1, Position(1))),
Elements(Points(X, Y(1), Y(2), Legend(3)))
)
3. 將點更改為線,我還將更改 Summary Statistic 的默認值,這樣我就可以看到如何在腳本中更改它

拿劇本
Graph Builder(
Variables(X(:lot_id), Y(:NPN1), Y(:PNP1, Position(1))),
Elements(Line(X, Y(1), Y(2), Legend(4), Summary Statistic("Median")))
)
4. 現在我有了很好的基線腳本來開始處理這個問題。 因為我知道回复:你能在不把表達式寫成字符串的情況下構造這個嗎?可以用來解決這個問題,我用它作為我的基線(我之前提供的腳本)。
有基本圖:
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Semiconductor Capability.jmp");
x_col = Column(dt, 1);
y_cols = (dt << Get Column Names())[5::N Cols(dt)];
var_expr = EvalExpr(
Variables(X(Expr(x_col))
));
For Each({col}, y_cols,
y_expr = Expr(Y(Position(1)));
Insert Into(y_expr, NameExpr(col), 1);
Insert Into(var_expr, Name Expr(y_expr));
);
gb = Eval(Substitute(
Expr(
gb = dt << Graph Builder(
Size(838, 391),
Show Control Panel(0),
vvv,
)
),
Expr(vvv), Name Expr(var_expr),
));
gb_image = gb << get picture;
gb << Close Window;
New window("test",
gb_image
);
現在,如果我想要線而不是點,我會檢查 JMP 之前給我的“線”腳本中必須更改的內容。 基本上我需要添加元素。
Elements(Line(X, Y(1), Y(2), Legend(4), Summary Statistic("Median")))
幸運的是,這些已添加到其他帖子中
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Semiconductor Capability.jmp");
x_col = Column(dt, 1);
y_cols = (dt << Get Column Names())[5::N Cols(dt)];
var_expr = EvalExpr(
Variables(X(Expr(x_col))
));
var_line = Expr(Line(X));
For Each({col, idx}, y_cols,
y_expr = Expr(Y(Position(1)));
Insert Into(y_expr, NameExpr(col), 1);
Insert Into(var_expr, Name Expr(y_expr));
yline_expr = Parse("Y("||char(idx)||")");
Insert Into(var_line, Name Expr(yline_expr));
);
gb = Eval(Substitute(
Expr(
gb = dt << Graph Builder(
Size(838, 391),
Show Control Panel(0),
vvv,
Elements(yyy)
)
),
Expr(vvv), Name Expr(var_expr),
Expr(yyy), Name Expr(var_line)
));
gb_image = gb << get picture;
gb << Close Window;
New window("test",
gb_image
);

(我沒有更改匯總統計信息,但在創建圖形構建器之前通過向 var_line 插入更多表達式來更改它們應該相當容易)
yline_expr = Expr(Legend(6));<BR />Insert Into(var_line, Name Expr(yline_expr));<BR />yline_expr = Expr(Summary Statistic("Median"));<BR />Insert Into(var_line, Name Expr(yline_expr));<BR />
知道如何使用 Expr、Substitute、NameExpr 等我是通過社區中的這幾篇文章學習的使用 Eval Insert、Eval Expr、Parse 和 Substitute 將一個表達式插入另一個表達式,表達式處理函數:第一部分 - 揭開 Expr()、NameExpr()、Eval()、... 難題經過大量的試驗和錯誤(我仍然對它們感到困惑,尤其是 Name Expr)
最後,如果我要將此腳本與您擁有的腳本結合使用(我會進一步清理它,更改表達式的順序,最有可能預填充列選擇器,並且可能提供選擇要使用的圖形類型的選項,但這應該給一個主意):
查看更多... 聽起來好像您是從頭開始生成 JSL……就像 Python 程序員所做的那樣,而不是採用您生成的交互式圖形生成器,然後讓 JMP 生成將創建圖形的 JSL。如果我交互式地創建下圖,

通過轉到紅色三角形並選擇“腳本”,它會生成一個處理兩個 Y 軸變量的腳本
Graph Builder(
Size( 528, 448 ),
Show Control Panel( 0 ),
Variables( X( :age ), Y( :height ), Y( :weight, Position( 1 ) ) ),
Elements(
Points( X, Y( 1 ), Y( 2 ), Legend( 5 ) ),
Smoother( X, Y( 1 ), Y( 2 ), Legend( 6 ) )
),
SendToReport(
Dispatch(
{},
"400",
ScaleBox,
{Legend Model(
5,
Base( 0, 0, 0, Item ID( "height", 1 ) ),
Base( 1, 0, 0, Item ID( "weight", 1 ) )
)}
)
)
);
現在,如果您的問題是,當您採用上述腳本並嘗試擴展它以處理所需數量的 Y 列時,有時可能需要做更多的工作。
這是一個相同結構的圖,但有更多的 Y 列

這是 JMP 生成的用於重新創建圖形的擴展 JSL
Graph Builder(
Size( 528, 458 ),
Show Control Panel( 0 ),
Variables(
X( :Wafer ID in lot ID ),
Y( :NPN1 ),
Y( :PNP1, Position( 1 ) ),
Y( :PNP2, Position( 1 ) ),
Y( :NPN2, Position( 1 ) ),
Y( :PNP3, Position( 1 ) ),
Y( :IVP1, Position( 1 ) ),
Y( :PNP4, Position( 1 ) )
),
Elements(
Points(
X,
Y( 1 ),
Y( 2 ),
Y( 3 ),
Y( 4 ),
Y( 5 ),
Y( 6 ),
Y( 7 ),
Legend( 3 )
),
Smoother(
X,
Y( 1 ),
Y( 2 ),
Y( 3 ),
Y( 4 ),
Y( 5 ),
Y( 6 ),
Y( 7 ),
Legend( 4 )
)
),
SendToReport(
Dispatch(
{},
"400",
ScaleBox,
{Legend Model(
3,
Base( 0, 0, 0, Item ID( "NPN1", 1 ) ),
Base( 1, 0, 0, Item ID( "PNP1", 1 ) ),
Base( 2, 0, 0, Item ID( "PNP2", 1 ) ),
Base( 3, 0, 0, Item ID( "NPN2", 1 ) ),
Base( 4, 0, 0, Item ID( "PNP3", 1 ) ),
Base( 5, 0, 0, Item ID( "IVP1", 1 ) ),
Base( 6, 0, 0, Item ID( "PNP4", 1 ) )
)}
)
)
);
Graph Builder(
Size( 528, 458 ),
Show Control Panel( 0 ),
Variables(
X( :Wafer ID in lot ID ),
Y( :NPN1 ),
Y( :PNP1, Position( 1 ) ),
Y( :PNP2, Position( 1 ) ),
Y( :NPN2, Position( 1 ) ),
Y( :PNP3, Position( 1 ) ),
Y( :IVP1, Position( 1 ) ),
Y( :PNP4, Position( 1 ) )
),
Elements(
Points(
X,
Y( 1 ),
Y( 2 ),
Y( 3 ),
Y( 4 ),
Y( 5 ),
Y( 6 ),
Y( 7 ),
Legend( 3 )
),
Smoother(
X,
Y( 1 ),
Y( 2 ),
Y( 3 ),
Y( 4 ),
Y( 5 ),
Y( 6 ),
Y( 7 ),
Legend( 4 )
)
),
SendToReport(
Dispatch(
{},
"400",
ScaleBox,
{Legend Model(
3,
Base( 0, 0, 0, Item ID( "NPN1", 1 ) ),
Base( 1, 0, 0, Item ID( "PNP1", 1 ) ),
Base( 2, 0, 0, Item ID( "PNP2", 1 ) ),
Base( 3, 0, 0, Item ID( "NPN2", 1 ) ),
Base( 4, 0, 0, Item ID( "PNP3", 1 ) ),
Base( 5, 0, 0, Item ID( "IVP1", 1 ) ),
Base( 6, 0, 0, Item ID( "PNP4", 1 ) )
)}
)
)
);
這是 JSL 程序員必須創建要執行的命令字符串以傳遞給 Graph Builder 的地方。如果您已經這樣做了,並且您只獲得了圖中的第一個 Y 變量,那麼通常發生的情況是 Graph Builder 無法評估傳遞給它的信息。如果您提供您正在使用的 JSL,社區通常會提供很好的幫助。
本主題可能會有所幫助:
回复:你能在不把表達式寫成字符串的情況下構造這個嗎?
這裡有很多表達式,您也可以使用 << Get picture 從圖形構建器中“刪除功能”
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Semiconductor Capability.jmp");
x_col = Column(dt, 1);
y_cols = (dt << Get Column Names())[5::N Cols(dt)];
var_expr = EvalExpr(
Variables(X(Expr(x_col))
));
For Each({col}, y_cols,
y_expr = Expr(Y(Position(1)));
Insert Into(y_expr, NameExpr(col), 1);
Insert Into(var_expr, Name Expr(y_expr));
);
gb = Eval(Substitute(
Expr(
gb = dt << Graph Builder(
Size(838, 391),
Show Control Panel(0),
vvv,
)
),
Expr(vvv), Name Expr(var_expr),
));
gb_image = gb << get picture;
gb << Close Window;
New window("test",
gb_image
);