JSL基於復選框替換框架框這是我的代碼
dt = Current Data Table();
listX = {"X"};
listY = {"Y1"};
bivExpr = Expr(
biv = Bivariate( Y( Eval List( listY ) ), X( Eval List( listx ) ) )
);
yListSelect = {"Y1", "Y2","Y3","Y4"};
BC_Indicator = Panel Box( "Choose",
indicatorSelected = Radio Box(
yListSelect,
listY = {};
Insert Into( listY, indicatorSelected << Get Selected );
//selecting a checkbox creates the new graph based on the new Y
bivExpr;
)
);
nw = New Window( "test",
H List Box(
obj = dt << Bivariate(
Y( Eval List( listY ) ),
X( Eval List( listX ) ),
Fit Spline( 0.1, standardized ),
SendToReport(
Dispatch(
{},
"Bivar Plot",
FrameBox,
{Frame Size( 493, 354 ), Marker Size( 2 ), Marker Drawing Mode( "Normal" ), Transparency( transparencyLegend ),
Row Legend(
dt:(fitVar),
Color( 1 ),
Color Theme( "JMP Default" ),
Marker( 0 ),
Marker Theme( "Standard" ),
Continuous Scale( Cont ),
Reverse Scale( 0 ),
Excluded Rows( 0 )
)}
)
)
),
BC_Indicator
)
);我的數據表
| X | Y1 | Y2 | Y3 | Y4 |
| 160.5893 | 194 | 16.79012 | 0.498753 | 7.26817 |
| 160.2228 | 234 | 20.4878 | 0.738916 | 4.466501 |
| 159.5072 | 240 | 15.53398 | 0.488998 | 5.159705 |
| 160.06 | 268 | 11.27098 | 1.213592 | 4.600484 |
| 160.9668 | 230 | 17.35941 | 0.2457 | 5.867971 |
| 159.3969 | 222 | 19.08213 | 0.980392 | 8.845209 |
| 161.0078 | 223 | 21.19701 | 0.75 | 6.766917 |
| 159.6957 | 201 | 21.44638 | 0.251889 | 9.343434 |
| 159.539 | 237 | 18.90547 | 0.498753 | 9 |
| 160.9438 | 210 | 16.38142 | 0.492611 | 9.605911 |
| 160.2693 | 229 | 19.11765 | 0.247525 | 8.188586 |
| 160.6793 | 220 | 17.07317 | 1.231527 | 6.157635 |
| 161.8911 | 187 | 21.62162 | 0.49505 | 9.158416 |
| 162.628 | 201 | 20.82324 | 0.977995 | 10.51345 |
| 162.8909 | 192 | 20.4878 | 0.4914 | 6.896552 |
| 163.0162 | 212 | 18.79518 | 0.243309 | 7.073171 |
| 160.8283 | 206 | 17.03163 | 0.490196 | 8.557457 |
| 160.3191 | 208 | 22.87105 | 0.490196 | 7.823961 |
| 160.3265 | 222 | 19.95134 | 1.466993 | 9.046455 |
| 160.2706 | 227 | 18.42752 | 0.740741 | 6.947891 |
| 162.8886 | 186 | 18.85856 | 0.250627 | 7.537688 |
| 162.8631 | 189 | 23.61446 | 0.728155 | 7.055961 |
| 161.1953 | 241 | 16.34146 | 0.492611 | 8.108108 |
| 161.2756 | 239 | 12.31527 | 0.492611 | 5.707196 |
| 160.1107 | 247 | 16.66667 | 0.487805 | 5.121951 |
| 161.368 | 201 | 19.85294 | 0.738916 | 6.451613 |
| 161.2246 | 218 | 20.19704 | 0.49505 | 7.5 |
| 160.0145 | 215 | 23.11436 | 0.735294 | 8.148148 |
| 161.6576 | 149 | 18.15182 | 0.33557 | 10.10101 |
| 159.5943 | 248 | 14.56311 | 0.4914 | 6.356968 |
| 159.8647 | 182 | 22.80702 | 1.772152 | 10.07557 |
| 160.3423 | 227 | 13.13869 | 0.244499 | 7.090465 |
| 161.7888 | 241 | 16.42512 | 0.484262 | 5.326877 |
| 162.0188 | 219 | 20.43269 | 0.973236 | 7.729469 |
如果您運行該腳本,您可以看到當選擇一個複選框時,它將打開一個帶有 X 乘 Y 的新窗口

我試圖了解如何替換當前窗口中的圖形並添加所有細節,如樣條線、標記等...
我嘗試查看“樹結構”,但不確定如何替換“framebox(1)”
謝謝!
腳本編寫回复:JSL 基於復選框替換框架框處理您想要的東西的最佳方法是使用列切換器

names default to here(1);
dt = Current Data Table();
Bivariate(
Y( :Y4 ),
X( :X ),
Fit Spline( 0.1, Standardized, {Line Color( {212, 73, 88} )} ),
Fit Spline( 10000, {Line Color( {61, 174, 70} )} ),
Column Switcher( :Y4, {:Y1, :Y2, :Y3, :Y4} ),
SendToReport(
Dispatch(
{},
"Bivar Plot",
FrameBox,
{Frame Size( 444, 359 ), Marker Size( 6 ),
Marker Drawing Mode( "Normal" ), Transparency( 0.5 ),
Row Legend(
Y2,
Color( 1 ),
Color Theme( "Blue to Gray to Red" ),
Marker( 0 ),
Marker Theme( "" ),
Continuous Scale( 1 ),
Reverse Scale( 0 ),
Excluded Rows( 0 )
)}
)
)
);
它允許以交互方式對圖形進行更改,然後當選擇新列時,所有更改都會應用於新列。
如果您仍然想不使用列切換器來執行此操作,您需要做的是在您的單選框中,當進行新選擇時,您提取雙變量的腳本,然後解析腳本,替換舊的列名,使用新的列名,刪除舊的雙變量報告,然後運行新修改的腳本。
回复:JSL 基於復選框替換框架框這有效,有沒有辦法創建行圖例選擇器,以便我可以在圖例之間切換,
假設我還有 2 行是這樣的:

然後在圖表中另外列選擇器我將在右側有一個圖例選擇器

我嘗試使用另一篇文章中的腳本,但每次切換行圖例時,它都會像這樣重複:

我嘗試查看樹結構並刪除,但它不起作用..
回复:JSL 基於復選框替換框架框我相信您可以通過使用本地數據過濾器並將其設置為多個選項之一來獲得所需的內容

names default to here(1);
dt = Current Data Table();
Bivariate(
Y( :Y4 ),
X( :X ),
Fit Spline( 0.1, Standardized, {Line Color( {212, 73, 88} )} ),
Fit Spline( 10000, {Line Color( {61, 174, 70} )} ),
Local Data Filter(
Auto clear( 1 ),
Add Filter( columns( :rowLeg1, :rowLeg2 ), Where( :rowLeg1 == "A" ) )
),
Column Switcher( :Y4, {:Y1, :Y2, :Y3, :Y4} ),
SendToReport(
Dispatch(
{},
"Bivar Plot",
FrameBox,
{Frame Size( 444, 359 ), Marker Size( 6 ),
Marker Drawing Mode( "Normal" ), Transparency( 0.5 ),
Row Legend(
Y2,
Color( 1 ),
Color Theme( "Blue to Gray to Red" ),
Marker( 0 ),
Marker Theme( "" ),
Continuous Scale( 1 ),
Reverse Scale( 0 ),
Excluded Rows( 0 )
)}
)
)
);
查看有關本地數據過濾器的文檔,了解如何更改它以使其滿足您的特定需求