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 x Y 的新窗口

我試圖了解如何替換當前窗口中的圖形,並添加所有詳細信息,如樣條線、標記等......
我嘗試查看“樹結構”,但不確定如何替換“framebox(1)”
謝謝!
高級統計建模大規模定制回复:JSL 替換基於復選框的框架框我沒有看到通過 JSL 刪除數字列的方法。
再看一遍,我想出了一種只顯示字符列的方法。
Names Default To Here( 1 );
dt = Open( "$sample_data/big class.jmp" );
dis = Distribution( Continuous Distribution( Column( :height ) ), Local Data Filter );
mylist = (Report( dis ) << top parent)["Local Data Filter"][ListBoxBox( 1 )] << get items;
For( i = N Items( myList ), i >= 1, i--,
If( Column( dt, myList[i] ) << get data type != "Character",
(Report( dis ) << top parent)["Local Data Filter"][ListBoxBox( 1 )] << remove item( i )
)
);
回复:JSL 替換基於復選框的框架框這很好用,查看了文檔但沒有找到如何做某事。不確定是否可能
在數據過濾器選項中,您可以取消選擇數字(下圖),我如何在 JSL 中執行此操作?

我嘗試關注這篇文章
https://community.jmp.com/t5/Discussions/Data-Filter-only-by-columns-that-are-of-type-character/td-p/39206
但我明白了:

但我真正想要的只是一個僅用字符過濾的列表,或者我是否可以按僅包含以“PC_”開頭的單詞的單詞進行過濾

https://community.jmp.com/t5/Discussions/Data-Filter-only-by-columns-that-are-of-type-character/td-p/39206
回复: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 )
)}
)
)
);
查看有關本地數據過濾器的文檔,了解如何更改它以使其滿足您的特定需求
回复:JSL 替換基於復選框的框架框這有效,有沒有辦法創建行圖例選擇器,以便我可以在圖例之間切換,
假設我還有兩行,如下所示:

然後在圖表中,除了列選擇器之外,我還將在右側有一個圖例選擇器

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

我嘗試檢查樹結構並刪除,但它不起作用。
回复: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 )
)}
)
)
);
它允許人們以交互方式對圖表進行更改,然後當選擇新列時,所有更改都會應用到新列。
如果您仍然想不使用列切換器來執行此操作,那麼您需要做的是在單選框中,當進行新選擇時,您提取雙變量的腳本,然後解析該腳本,替換舊的列名稱,使用新的列名稱,刪除舊的雙變量報告,然後運行新修改的腳本。