问题
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