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 |
如果您运行脚本,您可以看到选择一个复选框时,它将通过y打开x的新窗口

我试图了解如何替换当前窗口中的图形并添加所有细节,如样条线、标记等...
我尝试查看“树结构”,但不确定如何替换“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 )
)}
)
)
);
查看有关本地数据过滤器的文档,了解如何更改它以使其满足您的特定需求