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 ) ) )
);
Contours
Craige