How to plot only specific contours in matlab?
36 次查看(过去 30 天)
显示 更早的评论
Hello,
I would like to ask about contours plot in matlab. I would like to plot only specific contours of all my data. I have values ranrging from 10 to 10000. I would like to plot only the contousr with va;lues : 10, 100, 500, 1000 and 100000.
I am using these commands
t=importdata('input.txt');
x=t(:,1);
y=t(:,2);
z=t(:,5);
[xi, yi] = meshgrid(...
linspace(min(x),max(x)),...
linspace(min(y),max(y)));
zi = griddata(x,y,z, xi,yi,'natural');
figure(1)
contourf(xi,yi,zi,15,'LineStyle','none')
set(gca,'ColorScale','log')
colormap(flipud(hot(50)))
Could you please help me?
0 个评论
采纳的回答
dpb
2022-7-7
The third option down says
contourf(___,levels) specifies the contour lines to display as the last argument in any of the previous syntaxes. ... To draw the contour lines at specific heights, specify levels as a vector of monotonically increasing values. ...
Emphasis added, n levels and one level only options elided for brevity -- dpb
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Contour Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!