Overlapping contour labels?

回眸只為那壹抹淺笑 提交于 2019-12-24 12:07:47

问题


So I'm trying to do contour plotting with each contour representing an increment of 0.1 on a correlation map.

[c2,h2] = contourm(GlobalCorrs,geoidrefvec, .2:.1:1,'k','LineWidth',1);
ht2 = clabelm(c2,h2);

The issue is.. when there are multiple closely-spaced contours, they tend to overlap, as shown in the top picture below.

But if I zoom into the bottom picture here, I can see that the 0.4 label was covered by up the 0.2 and 0.3 labels. This is problematic since a correlation of 0.4 is a lot more significant than a correlation of 0.2.

Is there a way to fix this so that either (1) higher correlation labels can cover up lower correlation labels, or (2) where I can get the correlation labels to be more randomly spaced around the figures?


回答1:


The LabelSpacing property doesn't offer you enough flexibility. It could help in some lucky cases. I'd recommend: just set the labels manually:

clabel(C,h,'manual',...)

giving you a cross hair to define where to set the labels.



来源:https://stackoverflow.com/questions/20110780/overlapping-contour-labels

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!