用matlab画等值线图时,怎么使图中等值线标注数值上下对齐?
我使用contour函数画等值线图,但是数值分布实在太乱,很不美观,看一眼就让人头晕恶心那种……请教各位大虾如何使相邻线上的数值左右或者上下对齐...
我使用contour函数画等值线图,但是数值分布实在太乱,很不美观,看一眼就让人头晕恶心那种……请教各位大虾如何使相邻线上的数值左右或者上下对齐
展开
展开全部
没办法,clabel里'labelspacing'属性可以调整标注的疏密,加入参数'manual'可以手动指定标注的位置。
>> help clabel
CLABEL Contour plot elevation labels.
CLABEL(CS,H) adds height labels to the contour plot specified by H.
The labels are rotated and inserted within the contour lines. CS and H
are the contour matrix output and object handle outputs from CONTOUR,
CONTOUR3, or CONTOURF.
CLABEL(CS,H,V) labels just those contour levels given in
vector V. The default action is to label all known contours.
The label positions are selected randomly.
CLABEL(CS,H,'manual') places contour labels at the locations
clicked on with a mouse. Pressing the return key terminates
labeling. Use the space bar to enter contours and the arrow
keys to move the crosshair if no mouse is available.
CLABEL(CS) or CLABEL(CS,V) or CLABEL(CS,'manual') places
contour labels as above, except that the labels are drawn as
plus signs on the contour with a nearby height value.
H = CLABEL(...) returns handles to the TEXT (and possibly LINE)
objects in H. The UserData property of the TEXT objects contain
the height value for each label.
CLABEL(...,'text property',property_value,...) allows arbitrary
TEXT property/value pairs to specified for the label strings.
One special property ('LabelSpacing') is also available to specify
the spacing between labels (in points). This defaults to 144, or
2 inches.
Uses code by R. Pawlowicz to handle inline contour labels.
Example
subplot(1,3,1), [cs,h] = contour(peaks); clabel(cs,h,'labelspacing',72)
subplot(1,3,2), cs = contour(peaks); clabel(cs)
subplot(1,3,3), [cs,h] = contour(peaks);
clabel(cs,h,'fontsize',15,'color','r','rotation',0)
See also contour, contour3, contourf.
Reference page in Help browser
doc clabel
>> help clabel
CLABEL Contour plot elevation labels.
CLABEL(CS,H) adds height labels to the contour plot specified by H.
The labels are rotated and inserted within the contour lines. CS and H
are the contour matrix output and object handle outputs from CONTOUR,
CONTOUR3, or CONTOURF.
CLABEL(CS,H,V) labels just those contour levels given in
vector V. The default action is to label all known contours.
The label positions are selected randomly.
CLABEL(CS,H,'manual') places contour labels at the locations
clicked on with a mouse. Pressing the return key terminates
labeling. Use the space bar to enter contours and the arrow
keys to move the crosshair if no mouse is available.
CLABEL(CS) or CLABEL(CS,V) or CLABEL(CS,'manual') places
contour labels as above, except that the labels are drawn as
plus signs on the contour with a nearby height value.
H = CLABEL(...) returns handles to the TEXT (and possibly LINE)
objects in H. The UserData property of the TEXT objects contain
the height value for each label.
CLABEL(...,'text property',property_value,...) allows arbitrary
TEXT property/value pairs to specified for the label strings.
One special property ('LabelSpacing') is also available to specify
the spacing between labels (in points). This defaults to 144, or
2 inches.
Uses code by R. Pawlowicz to handle inline contour labels.
Example
subplot(1,3,1), [cs,h] = contour(peaks); clabel(cs,h,'labelspacing',72)
subplot(1,3,2), cs = contour(peaks); clabel(cs)
subplot(1,3,3), [cs,h] = contour(peaks);
clabel(cs,h,'fontsize',15,'color','r','rotation',0)
See also contour, contour3, contourf.
Reference page in Help browser
doc clabel
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
东莞大凡
2024-11-19 广告
2024-11-19 广告
板格标定棋盘是我们东莞市大凡光学科技有限公司在精密光学测量领域的重要工具。它采用高精度设计,确保每一个格板都达到严格的校准标准。通过使用板格标定棋盘,我们能够有效地对光学测量系统进行校准,从而提升测量的准确性和可靠性。这一工具在光学仪器的研...
点击进入详情页
本回答由东莞大凡提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询