Hi,
I'm trying to script a Graph Builder step in a workflow. I want to take a list of columns and plot them in Graph Builder with them all placed in the X axis field using the parallel axis merging. I had asked a question before about using the parallel axis merging within Graph Builder at the following link: Solved: How to Get Continuous Line Plot in Graph Builder for Multiple Variables in X - JMP User Community.
My next step is to find a way to dynamically build the graph using a list of column names. Below is some sample data and the Graph Builder script I got from making the graph. I tried simply passing the list of columns to the X variable but that only returned a graph with the first value. Is there an elegant way to pass the list of columns or does it require a loop to write the text and then substitute that into function?
I'd greatly appreciate if any one could help me figure out the best way to do this.
Kind regards,
Cathal
New Table( "Spectra",
Add Rows( 29 ),
New Column( "X__1",
Numeric,
"Continuous",
Format( "Best", 15 ),
Set Values(
[10.963, 10.451, 10.325, 11.131, 10.742, 11.834, 12.615, 11.841, 11.731,
12.213, 10.963, 10.451, 10.325, 11.131, 10.742, 11.834, 12.615, 11.841,
11.731, 12.213, 5.84, 5.986, 5.715, 5.575, 5.607, 5.531, 5.573, 5.296,
5.268]
)
),
New Column( "X__2",
Numeric,
"Continuous",
Format( "Best", 15 ),
Set Values(
[22.565, 20.785, 21.746, 22.137, 22.377, 22.668, 21.321, 21.73, 21.747,
22.082, 22.565, 20.785, 21.746, 22.137, 22.377, 22.668, 21.321, 21.73,
21.747, 22.082, 11.354, 11.572, 10.902, 11.106, 10.62, 10.734, 11.467,
10.384, 10.862]
)
),
New Column( "X__3",
Numeric,
"Continuous",
Format( "Best", 15 ),
Set Values(
[23.621, 21.539, 23.193, 23.267, 23.477, 23.499, 20.898, 21.782, 19.149,
20.756, 23.621, 21.539, 23.193, 23.267, 23.477, 23.499, 20.898, 21.782,
19.149, 20.756, 11.534, 10.964, 10.882, 10.771, 11.39, 11.106, 11.463,
11.036, 11.645]
)
),
New Column( "X__4",
Numeric,
"Continuous",
Format( "Best", 15 ),
Set Values(
[15.819, 14.54, 16.203, 15.372, 14.921, 13.934, 13.936, 13.104, 13.252,
13.967, 15.819, 14.54, 16.203, 15.372, 14.921, 13.934, 13.936, 13.104,
13.252, 13.967, 7.218, 7.944, 7.265, 7.287, 7.699, 7.874, 8.234, 7.439,
8.591]
)
),
New Column( "X__5",
Numeric,
"Continuous",
Format( "Best", 15 ),
Set Values(
[4.284, 4.556, 4.685, 4.576, 4.588, 4.358, 3.635, 4.352, 3.508, 4.131,
4.284, 4.556, 4.685, 4.576, 4.588, 4.358, 3.635, 4.352, 3.508, 4.131,
2.494, 2.799, 2.178, 2.511, 2.661, 2.373, 2.326, 2.591, 3.111]
)
),
New Column( "X__6",
Numeric,
"Continuous",
Format( "Best", 15 ),
Set Values(
[0.959, 1.416, 1.373, 1.242, 1.275, 1.113, 1.449, 1.494, 1.025, 1.048,
0.959, 1.416, 1.373, 1.242, 1.275, 1.113, 1.449, 1.494, 1.025, 1.048,
0.847, 0.914, 0.763, 0.771, 0.79, 0.644, 0.639, 0.771, 0.848]
)
),
New Column( "X__7",
Numeric,
"Continuous",
Format( "Best", 15 ),
Set Values(
[0.357, 0.574, 0.492, 0.582, 0.487, 0.498, 0.587, 0.6, 0.373, 0.552,
0.357, 0.574, 0.492, 0.582, 0.487, 0.498, 0.587, 0.6, 0.373, 0.552,
0.358, 0.403, 0.281, 0.378, 0.412, 0.357, 0.286, 0.309, 0.416]
)
),
New Column( "X__8",
Numeric,
"Continuous",
Format( "Best", 15 ),
Set Values(
[0.248, 0.37, 0.33, 0.374, 0.311, 0.561, 0.411, 0.336, 0.372, 0.277,
0.248, 0.37, 0.33, 0.374, 0.311, 0.561, 0.411, 0.336, 0.372, 0.277,
0.193, 0.241, 0.196, 0.242, 0.269, 0.235, 0, 0, 0.309]
)
),
New Column( "X__9",
Numeric,
"Continuous",
Format( "Best", 15 ),
Set Values(
[3.516, 3.689, 3.175, 3.045, 3.575, 3.397, 2.862, 3.026, 4.14, 3.579,
3.516, 3.689, 3.175, 3.045, 3.575, 3.397, 2.862, 3.026, 4.14, 3.579,
1.151, 1.39, 1.809, 1.735, 1.342, 1.624, 1.311, 1.068, 1.62]
)
),
New Column( "X__10",
Numeric,
"Continuous",
Format( "Best", 15 ),
Set Values(
[23.754, 21.85, 22.825, 23.564, 22.097, 21.678, 22.293, 20.308, 25.639,
23.728, 23.754, 21.85, 22.825, 23.564, 22.097, 21.678, 22.293, 20.308,
25.639, 23.728, 9.808, 9.801, 9.248, 9.754, 10.548, 9.692, 9.512, 9.466,
9.666]
)
),
New Column( "X__11",
Numeric,
"Continuous",
Format( "Best", 15 ),
Set Values(
[77.806, 78.581, 77.367, 83.74, 79.909, 77.816, 80.618, 76.621, 81.94,
76.984, 77.806, 78.581, 77.367, 83.74, 79.909, 77.816, 80.618, 76.621,
81.94, 76.984, 39.768, 40.147, 38.28, 39.133, 41.464, 41.854, 38.858,
40.516, 38.15]
)
)
);
Graph Builder(
Variables(
X( :X__1, Combine( "Parallel Merged" ) ),
X( :X__2, Position( 1 ), Combine( "Parallel Merged" ) ),
X( :X__3, Position( 1 ), Combine( "Parallel Merged" ) ),
X( :X__4, Position( 1 ), Combine( "Parallel Merged" ) ),
X( :X__5, Position( 1 ), Combine( "Parallel Merged" ) ),
X( :X__6, Position( 1 ), Combine( "Parallel Merged" ) ),
X( :X__7, Position( 1 ), Combine( "Parallel Merged" ) ),
X( :X__8, Position( 1 ), Combine( "Parallel Merged" ) ),
X( :X__9, Position( 1 ), Combine( "Parallel Merged" ) ),
X( :X__10, Position( 1 ), Combine( "Parallel Merged" ) ),
X( :X__11, Position( 1 ), Combine( "Parallel Merged" ) )
),
Elements(
Line(
X( 1 ),
X( 2 ),
X( 3 ),
X( 4 ),
X( 5 ),
X( 6 ),
X( 7 ),
X( 8 ),
X( 9 ),
X( 10 ),
X( 11 ),
Legend( 4 )
)
)
);