フィルターのクリア

Change clabel stacking order

1 回表示 (過去 30 日間)
Alli Whalley
Alli Whalley 2020 年 10 月 31 日
Hi,
I'm adding clabels to my contourf plot. There are some areas where the labels are stacked on top of each other so you can't see the ones below. I'm ok with this, but I'd like the extreme values to be visible. Currently, they are stacked from low to high, so my positive extreme values are visible but my negative extremes get lost underneath.
This is my current code (which doesn't work):
[y,z] = contourf(ax(1),pos.y1/H,pos.z1/H,zdata(pos.n1),cmap,'showtext','on','linestyle',':'); %plotting
negV = flip(cmap(1:24)); %reordering the vector so extreme neg values occur later (hoping they'll stack on top)
posV = cmap(25:length(cmap));
v = [negV,posV]; %putting them back together
clabel(y,z,v,'fontsize',5,'margin',0.1,'BackGroundColor',[1 1 1],'EdgeColor',[0 0 0],'linewidth',0.1) %adding labels
This is what one of my plots looks like. You can see how the larger negative values are stacked below the smaller negative values.
Thanks!

回答 (0 件)

カテゴリ

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

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by