Colormap based on order in heatmap

3 次查看(过去 30 天)
I am working on a heatmap to visualize specific test results. The data consists of 10 values between 0 and 0.1 which are not normally distributed:
0.0920200000000000 0.0926500000000000 0.0960900000000000 0.0955800000000000 0.0931500000000000
0.0942300000000000 0.0963800000000000 0.0938100000000000 0.0936100000000000 0.0926700000000000
I am looking for a way to heatmap these values and color them according to their position in the order hierarchy.
[Up_sort,Up_sort_I] = sort(Current_up_means,'descend');
A = [flip( ...
Current_up_means(6:10));
Current_up_means(1:5)];
A = figure();
heatmap(A,"Colormap",ndvi_colormap);
This results in the following var:
Up_sort_I = 2 7 8 6 1 3 9 4 10 5
Now my goal is to color the values according to their rank just like Excel does in Conditional formatting from rank 1 to 10 Green to Red. So not based on value but simply on its place within that dataset hierarchy. So how can i use Up_sort_I as an input for the color while maintaining the vizualized original values? It is important that the values remain in their original position as im visualizing production defects.

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Data Distribution Plots 的更多信息

产品


版本

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by