For example, in the drawing of JSL the following values
Color Levels([-7.28 -1.99 3.3 8.59 13.88]);
How can I write code in this form?
x1=-7.28; x2=13.88; Color Levels([x1 -1.99 3.3 8.59 x2]);
Thanks!
Matrices can be a little tricky, but here is what I do in that situation:
x1 = -7.28; x2 = 13.88; Color Levels( (x1 |/ [-1.99 3.3 8.59]` |/ x2)` );
This uses the matrix join operator |/ then a few transposes to make it have the correct dimensions
|/
If you construct your matrix using the Matrix() function you can call in variables as arguments directly. For example:
x1=-7.28; x2=13.88; mat = matrix({x1,-1.99, 3.3, 8.59, x2})` //notice the need to transpose; the syntax is easier to construct this way
Here's a more complete building the entire matrix dynamically:
Names Default To Here( 1 ); x1=100000; x2=1000000; x3=10000000; dt = Open( "$SAMPLE_DATA/PopAgeGroup.jmp" ); obj = dt << Bubble Plot( X( :"Portion 0-19"n ), Y( :"Portion60+"n ), Sizes( :Pop ), ID( :Country ), Coloring( :Pop ) ); obj << Color Levels( matrix({x1,x2,x3})` );
I hope this helps!
@jules
OK