When using clabel to label contour lines, is there a way to manually adjust the gap in the contour line for the label?

5 ビュー (過去 30 日間)
The gaps in the contour lines over lap labeling after adjusting the format of the label to xe^x, font size to 16 and line width to 2.5. Is there a way to "update" the gap size after these adjustments have been made?
h=figure(Number);
clf, grid on, hold on,
% disp('TP1'),
[C,H] = contour(X,Y,Z,V,'-k','Clipping','off','LineWidth',2.5);
set(gca,'FontSize',16),
% disp('TP2'),
text_handles=clabel(C,H,v,'LabelSpacing',500,'FontSize',16);
[j ~]=size(text_handles);
% disp('TP3'),
for i=1:j,
% i,disp('TP4'),
a=get(text_handles(i),'UserData');
y=char(num2str(a,'%5.0e'));
set(text_handles(i),'String', y);% ,'Interpreter','LaTex');
end
I submitted a bug report on this and they forwarded to the enhancement team and confirmed that they were not able to find a work around for the issue.
  1 件のコメント
Matt Fig
Matt Fig 2012 年 12 月 6 日
Can you give some data that shows the problem? Like:
[X,Y,Z] = peaks(300);
contour(Z)
Or manipulate the peaks data so that we all can see what you see.

サインインしてコメントする。

採用された回答

Nathan
Nathan 2014 年 4 月 11 日
To my knowledge there isn't a straight forward way built into matlab to do this.

その他の回答 (1 件)

David
David 2014 年 4 月 27 日
So how did you work around this problem, Nathan? I have the same problem. I want to make my labeling size 18, but then the lines and the numbers are overlapping. See the attached contour plot below. I have tried to both to specify the label fontsize in the clabel command:
clabel(o1,o2,'fontsize',18,'color',[1 1 1])
and by creating an object:
hh = clabel (o1, o2)
set (hh, 'fontsize', 18,'color',[1 1 1])
but I get the same contour plot in either case.
Does anyone know how to avoid the lines overlapping the labels when the label text size is big? Any help is appreciated.
  1 件のコメント
Platon Patlakas
Platon Patlakas 2017 年 9 月 23 日
Did you find something? I am facing even bigger problems using contourm.
Thanks in advance.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeContour Plots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by