Необходимо определить свойство Faces
, чтобы цвета заполняли полосы перпендикулярно оси (см. Указание граней и вершин ).В противном случае MATLAB будет использовать некоторый алгоритм, чтобы смешать цвет так гладко, как он видит.
N=120;
a = pi/7;
theta = linspace(a,2*pi+a,N+1); % note that I changed the point sequence, this is just to make it easier to produce the matrix for Faces.
theta(end) = [];
ids = (1:N/2)';
faces = [ids, ids+1, N-ids, N-ids+1];
c = exp(-6*cos(a-theta))';
figure
patch('Faces', faces, 'Vertices',[cos(theta);sin(theta)]','FaceVertexCData',c, 'FaceColor', 'interp', 'EdgeColor', 'none')
ylabel('y'); xlabel('x')
axis equal
