MATLAB - Contour plot with only 2 colours? -
i plotting contour plots in matlab using vectors. using contourf command filled contour. thing data discrete (only has values 0 & 1) still matlab interpolates color in contour plot, don't want. want 2 colors plot - 0 defining black, 1 defining white. these colors should represent actual data being plotted.
you need specify levels in contourf
:
%# create contours colors indicating 0 , 1 contourf(x,y,z,[0 1]) %# set colormap black/white colormap([0 0 0;1 1 1])
Comments
Post a Comment