필터 지우기
필터 지우기

Drawing boundary lines in contour plot

조회 수: 8 (최근 30일)
Alexander Engman
Alexander Engman 2018년 4월 19일
댓글: Alexander Engman 2018년 4월 19일

Hi!

I am creating a contour plot which I have attached. The data comes from a matrix named OPT that contains the values that I have plotted over the matrices Vfvec and rvec. The white areas of the plot come from the fact that OPT contains many NaN values, as it should.

What I would like to do is to make it more clear where the boundary of the contour plot is. Basically, I would like to draw a line connecting the ends of the contour lines on each side, so that it becomes very clear which part of the plot contains numerical values and which doesnt. I could also do this by just adding more lines to the plot, but then the contour labels rendered using clabel become messy. The do not appear as integers, and there are way too many of them.

So can someone explain either how can accomplish the first part (connecting the boundaries), or alternatively add more contour lines but controlling clabel properties to be integers and spaced manually?

Any other methods that you know for presenting the data in a proper way would be appreciated.

h=mesh(Vfvecq,rvecq,OPTq);
grid off
view(2)
set(h,'linestyle','none')
[C,h]=contour(Vfvecq, rvecq, OPTq,'Color','k','ShowText','on');
clabel(C,h,...
    'FontUnits','points',...
    'FontWeight','normal',...
    'FontSize',9,...
    'FontName','Times')
  댓글 수: 2
jonas
jonas 2018년 4월 19일
Alloy2 looks nice, whereas Alloy1 is too dense.
If you want to outline the edges of your data, then you could use something like boundary()
You could also shade the background where data is missing, use surf() to show all data, or combine surf and contour in a single plot. The best option depends on what you want to show with the figure
Alexander Engman
Alexander Engman 2018년 4월 19일
Boundary was what I was looking for. Thanks!

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Contour Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by