我想獲得一個類似於下面的腳本但具有不同數據格式的列錶框圖。 我的數據看起來更像下表,其中要繪製的所有數據都在前兩列中。 我希望列錶框中的列表部分是測試計數,當我單擊測試計數時,它會生成正向和反向圖。
這可能嗎?我能否獲得一些有關如何使其工作的指導。 我是 JMP 新手,我不完全確定從哪裡開始。
我的數據格式
| V1 | I1 | 測試計數 | 掃描類型 |
| 0 | 0 | 1 | 向前 |
| 1 | .1 | 1 | 向前 |
| 2 | .2 | 1 | 向前 |
| 0 | 0 | 1 | 撤銷 |
| -1 | -.1 | 1 | 撤銷 |
| -2 | -.2 | 1 | 撤銷 |
| 0 | 0 | 2 | 向前 |
| 1 | .1 | 2 | 向前 |
| 2 | .2 | 2 | 向前 |
來自示例數據的列錶框示例
// Listbox_Graphs.jsl
// Display one graph at a time using a listbox to select which one
names default to here(1);
dt = open("$sample_data\CrimeData.jmp", invisible);
xcol = "Year";
ycols = {"Population", "Total Rate", "Violent Rate", "Property Rate", "Murder Rate",
"Rape Rate", "Robbery Rate", "Agg-Aslt Rate", "Burglary Rate", "Larceny Rate",
"MVTheft Rate", "Murder", "Rape", "Robbery", "Agg-Aslt", "Burglary", "Larceny",
"MVTheft", "Total", "Violent", "Property", "Latitude", "Longitude"};
gb_expr = {};
for(i = 1, i <= nitems(ycols), i++,
ycol = ycols[i];
// Define an array of graph builder expressions, one for each y column
one_expr = evalinsert(
"\[gb_expr[^i^] = expr(
dt << Graph Builder(
Show Control Panel( 0 ),
Variables( X( :Name( "^xcol^" ) ), Y( :Name( "^ycol^" ) ) ),
Elements( Points( X, Y, Legend( 5 ) ), Smoother( X, Y, Legend( 6 ) ) )
),
);
]\");
eval(parse(one_expr));
);
// Code to run when a different y variable is selected
y_list_expr = expr(
y_mtx = y_lb << get selected indices;
y_i = y_mtx[1];
hlb << delete;
vlb << append(
hlb = hlistbox(
eval(gb_expr[y_i])
)
);
);
gw = new window("Graphical Output",
hlistbox(
panel box(
xcol || " vs:",
y_lb = list box(ycols,
width(250),
nlines(20),
max selected(1),
y_list_expr,
)
),
panel box("Graph",
vlb = vlistbox(
hlb = hlistbox(
eval(gb_expr[1]),
)
)
)
)
);
y_lb << set selected(1);