필터 지우기
필터 지우기

How to omit zero value line in contourm figure

조회 수: 6 (최근 30일)
chia hua
chia hua 2013년 5월 26일
Hi I want to have a contour plot without zero value line,
I have been search internet and matlab Q&A for a long time,
but can't find answer , how can I do this ?
P.S. I know contour plot can give the line interval you want to avoid zero line,but I have several figures and each one has different scale, so is there any method to omit zero line after you draw the figure ?
thank you
this is my figure link
  댓글 수: 2
Artur M. G. Lourenço
Artur M. G. Lourenço 2013년 5월 26일
your image is a raster (pictorios) or vector?
chia hua
chia hua 2013년 5월 26일
편집: Walter Roberson 2013년 5월 26일
set(gcf,'PaperPositionMode','auto')
set(hFig, 'Position', [350 200 800 800]) axesm ('stereo','Grid', 'off','MapLatLimit',[ys 90],'Origin',[90 120 0],'Frame','on','FLineWidth',2,... 'MeridianLabel','off','MLabelParallel','south','LabelRotation','off');
axis off
load coast
plotm(lat, long,'k-','color',[0.4,0.4,0.4],'LineWidth',1)
projn=[reco,reco(:,1)];
hold on
[C,h]=contourm(yy,[xx,360],projn,'k-','LineWidth',1,'LevelStep',int);
this is my code , I think it is vector..?
xx,yy : grid
projn : data

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

채택된 답변

Walter Roberson
Walter Roberson 2013년 5월 26일
Yes, it is possible to remove the 0 contour after drawing... and what if there is no contour at exactly 0 because your "int" steps ended up with the closest division being at (say) -1/10? Or -5000 depending on the scale of the data.
You are better of figuring out exactly where you want the contours, and providing that list of levels as the argument after "projn" in your call. That way you could figure out how big you want your steps to be, and you could round() the levels to "nice numbers" using what-ever algorithm you liked, and you could decide whether you just want the 0 deleted (leaving a double-width near 0) or if you want to instead center the equal-sized steps so that 0 is in the middle between two steps.

추가 답변 (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