How to show values on heatmap belonging to a different dataset.
4 次查看(过去 30 天)
显示 更早的评论
I have a torque and RPM dataset and i am plotting %torque using heatmap. but the value(text) in each grid of %torque heatmap i want to display some other data set number. The reason i am doing this is so that in the background i can see %torque heatmap and see the color and on top of it will have the value of the other data set which me help me compare the value. Can this be done in matlab??
Thanks
5 个评论
采纳的回答
jonas
2018-9-10
Here's an example using imagesc and text
% Grid
[X,Y]=meshgrid(1:10,1:10);
% Two data sets to compare
A=rand(10,10);
B=-10.*rand(10,10);
% Plot grid
figure;
h=imagesc(X(:),Y(:),A)
% Text
txt=sprintfc('%.1f',B(:))
text(X(:),Y(:),txt,'horizontalalignment','center','verticalalignment','middle')
colorbar
You can of course easily change the grid dimensions if you want something more meaningful on the axes.
3 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Data Distribution Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!