colormap总是蓝色的阴影

8 views (last 30 days)
Lotmeri
Lotmeri 在26 Nov 2021
编辑: DGM 在29 Nov 2021
Hello, I am having a problem with the colormap... I'd like to have a picture like the one on the top... I ran the code and then I re-run in another PC (with a different version of Matlab --> r2020 vs r2021b)... And what I obtained with the SAME code is the graph on the bottom. Do you have a solution? Because I red that it happens sometimes, but I couldn't find a solution. Thank you in advance.
2 Comments
Lotmeri
Lotmeri 在29 Nov 2021
angle=[5.58,3.49,4.19,0.35,2.79,3.49,3.14,3.49,3.14,5.58,0.35,0.35,3.14,3.84,2.79,3.84,3.14];
d=[15.83,8.46,11.69,10.18,11.05,10.79,6.72,10.59,9.89,10.23,10.33,9.32,10.02,8.14,10.88,8.07,6.61];
P=[-129.89,-129.76,-128.61,-128.32,-127.83,-127.75,-127.64,-127.40,-127.32,-127.22,-126.49,-125.19,-123.50,-120.44,-115.72,-111.30,-101.68];
Pmax=min(P);
pmin = max(p);
delta_c = (Pmax - Pmin) / 63;
cmap_dB = Pmin + (0:63) * delta_c;
n_tot =长度(p);
forindex = 1:n_tot
h = polarplot(angle(index), dist_estim(index),'o'); hold;
[val,index_color] = min(abs(p(index)-cmap_db));
map = colormap('jet');
set(h,'MarkerFaceColor',地图(index_color,:));
set(h,“标记为彩色”,地图(index_color,:));
set(h,“标记”, 11);
end
Thank you.

Sign in to comment.

Accepted Answer

DGM
DGM 在29 Nov 2021
编辑:DGM 在29 Nov 2021
您没有指定结肠长度。如果您不这样做, 结肠() will create a map equal to the length of the current map. In earlier versions, the default length is 64, while in newer versions, it's 256. That said, if you had previously ran a script that set 菌落(Parula(17)) , calling 结肠(jet) will create a map of length 17 instead of 64 or 256. In other words, if you don't explicitly specify the map length, you have no control over how long the map is.
地图=喷气(元素个数(cmap_dB));% just get the map; don't need colormap()
对于它的价值,您也可以使用PolarScatter()来完成此操作
angle=[5.58,3.49,4.19,0.35,2.79,3.49,3.14,3.49,3.14,5.58,0.35,0.35,3.14,3.84,2.79,3.84,3.14];
d=[15.83,8.46,11.69,10.18,11.05,10.79,6.72,10.59,9.89,10.23,10.33,9.32,10.02,8.14,10.88,8.07,6.61];
P=[-129.89,-129.76,-128.61,-128.32,-127.83,-127.75,-127.64,-127.40,-127.32,-127.22,-126.49,-125.19,-123.50,-120.44,-115.72,-111.30,-101.68];
Pmax=min(P);
pmin = max(p);
delta_c = (Pmax - Pmin) / 63;
cmap_dB = Pmin + (0:63) * delta_c;
地图=喷气(元素个数(cmap_dB));% specify map length
[〜,idx] = min(abs(p -cmap_db。'));
h = polarscatter(angle, d, 75, map(idx,:),'filled');

More Answers (0)

s manbetx 845


释放

R2021b

Community Treasure Hunt

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

开始狩猎!