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

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -