cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar

How to fix my x,y, on my Z HEIGHT coordinate Contour Map

Trying to use x,y coordinates to make boundaries for regions with a height of Z (indicated by the numbers in the drawing).

I'm using JMP Pro 16.
contaour plot.jpg

1 ACCEPTED SOLUTION

Accepted Solutions
Craige_Hales
Super User

Re: How to fix my x,y, on my Z HEIGHT coordinate Contour Map

Something like this?

field=[
1 1 1 1 3 3 3 3 3 4 4 4 4 4 2,
1 1 1 3 3 3 3 3 4 4 4 4 4 2 2,
1 1 3 3 3 3 3 4 4 4 4 4 2 2 2,
1 3 3 3 3 3 4 4 4 4 4 2 2 2 2,
3 3 3 3 3 4 4 4 4 4 2 2 2 2 2,
3 3 3 3 4 4 4 4 4 2 2 2 2 2 1,
3 3 3 4 4 4 4 4 2 2 2 2 2 1 1,
3 3 4 4 4 4 4 2 2 2 2 2 1 1 1,
3 4 4 4 4 4 2 2 2 2 2 1 1 1 1,
4 4 4 4 4 2 2 2 2 2 1 1 1 1 1,
4 4 4 4 2 2 2 2 2 1 1 1 1 1 2,
4 4 4 2 2 2 2 2 1 1 1 1 1 2 2,
4 4 2 2 2 2 2 1 1 1 1 1 2 2 2,
4 2 2 2 2 2 1 1 1 1 1 2 2 2 2,
2 2 2 2 2 1 1 1 1 1 2 2 2 2 2
];

dt = New Table( "grid",
    New Column( "x", Numeric, "Continuous", Format( "Best", 12 ) ),
    New Column( "y", Numeric, "Continuous", Format( "Best", 12 ) ),
    New Column( "z", Numeric, "Continuous", Format( "Best", 12 ) )
);
For( ix = 1, ix <= N Cols( field ), ix += 1,
    For( iy = 1, iy <= N Rows( field ), iy += 1,
        dt << addrows( 1 );
        dt:x[N Rows( dt )] = ix;
        dt:y[N Rows( dt )] = nrows(field) + 1 - iy; // flip vertical axis
        dt:z[N Rows( dt )] = field[iy, ix];
    )
);
 
dt << Graph Builder(
    Size( 521, 452 ),
    Show Control Panel( 0 ),
    Variables( X( :x ), Y( :y ), Overlay( :z ) ),
    Elements( Contour( X, Y, Legend( 5 ) ) )
);

ContoursContours

Craige

View solution in original post

1 REPLY 1
Craige_Hales
Super User

Re: How to fix my x,y, on my Z HEIGHT coordinate Contour Map

Something like this?

field=[
1 1 1 1 3 3 3 3 3 4 4 4 4 4 2,
1 1 1 3 3 3 3 3 4 4 4 4 4 2 2,
1 1 3 3 3 3 3 4 4 4 4 4 2 2 2,
1 3 3 3 3 3 4 4 4 4 4 2 2 2 2,
3 3 3 3 3 4 4 4 4 4 2 2 2 2 2,
3 3 3 3 4 4 4 4 4 2 2 2 2 2 1,
3 3 3 4 4 4 4 4 2 2 2 2 2 1 1,
3 3 4 4 4 4 4 2 2 2 2 2 1 1 1,
3 4 4 4 4 4 2 2 2 2 2 1 1 1 1,
4 4 4 4 4 2 2 2 2 2 1 1 1 1 1,
4 4 4 4 2 2 2 2 2 1 1 1 1 1 2,
4 4 4 2 2 2 2 2 1 1 1 1 1 2 2,
4 4 2 2 2 2 2 1 1 1 1 1 2 2 2,
4 2 2 2 2 2 1 1 1 1 1 2 2 2 2,
2 2 2 2 2 1 1 1 1 1 2 2 2 2 2
];

dt = New Table( "grid",
    New Column( "x", Numeric, "Continuous", Format( "Best", 12 ) ),
    New Column( "y", Numeric, "Continuous", Format( "Best", 12 ) ),
    New Column( "z", Numeric, "Continuous", Format( "Best", 12 ) )
);
For( ix = 1, ix <= N Cols( field ), ix += 1,
    For( iy = 1, iy <= N Rows( field ), iy += 1,
        dt << addrows( 1 );
        dt:x[N Rows( dt )] = ix;
        dt:y[N Rows( dt )] = nrows(field) + 1 - iy; // flip vertical axis
        dt:z[N Rows( dt )] = field[iy, ix];
    )
);
 
dt << Graph Builder(
    Size( 521, 452 ),
    Show Control Panel( 0 ),
    Variables( X( :x ), Y( :y ), Overlay( :z ) ),
    Elements( Contour( X, Y, Legend( 5 ) ) )
);

ContoursContours

Craige