matlab contourf with gradual change of color

contour, matlab, plot

Solution

Cinico's solution didn't work for me. Here's what I used:

% Set Data
data = (1:100)'*(1:100);

figure;
subplot(1,2,1)
% Binned Color
contourf(data);
subplot(1,2,2)
% Gradual Color
pcolor(data);
hold on;
shading interp; 
contour(data,'LineColor','k')

Output:

Problem

folks, I have an image matrix and created the following figure using ``` contourf(my_matrix) colorbar ``` Is it possible to make the color change gradually between the contour lines, instead of filling these spaces with solid color? Thanks very much for your help.

Original source