MATLAB: Stop contourf from interpolating between the grid

contourf

I am using a contourf plot of the form: contourf(B0, B1, Z)
The spacing of B0 and B1 is .05.
The function values in Z only take on a few discrete values.
The resulting behavior is that if say Z(b0,b1) = 1 and Z(b0+1,b1) = 2, then MATLAB draws many contours between the two points, thereby creating many lines between the two points.
Is there a way to prevent this behavior?
My initial thought was to try to specify the number of contours directly. However, when this is done MATLAB just fills the region between the two points with one of the other colors being used, which is also not appropriate.

Best Answer

Turns out the pcolor command works for what I want.
colormap(gray(length(unique(Z))));
h = pcolor(B0,B1,Z);
caxis([-.5 1]);
xlim([-.2 1.6]);
ylim([-1 1]);
set(h, 'EdgeColor', 'none');