我已经使用MatLab的轮廓功能,用hold on命令在matlab中绘制了多个轮廓。如果我想在第一个和最后一个轮廓之间填充颜色,我该如何继续。我尝试过contourf函数,但它不是这样工作的。
提前谢谢。
我写了两条简单的线,在每次迭代后绘制零水平集的等高线。
hold on;
contour(X,Y,phi,[0,0],'r');
发布于 2013-07-18 11:39:40
这可以通过使用get
命令从图形中获取各个组件来完成。例如:
[x, y, z] = peaks; % Generate some data
figure; surf(x, y, z); % Show
figure;[c, h] = contourf(x, y, z, [0 0]); % Build and show contour plot
patches = get(h, 'children'); % Get different patches
set(patches(1), 'facecolor', 'r') % Colour one red
https://stackoverflow.com/questions/17708375
复制