HOW TO DISPLAY VALUE OF BARS USING BAR3

8 ビュー (過去 30 日間)
Dhruba jyoti Bora
Dhruba jyoti Bora 2018 年 11 月 26 日
回答済み: YT 2018 年 11 月 26 日
I have a matrix x with 3 rows and 4 columns.
x =
1.0e+05 *
9.1168 9.1168 2.2792 1.3675
4.8544 4.8544 1.2136 0.7282
0.6357 0.6357 0.1589 0.0954
Now the matrix x is generated after running a particular code. I have successfully plotted the matrix according to my requirements using the codes
bar3(x);
title('Norm of derivative for Lykken Model');
set(gca,'xtickLabel',{'dist12','dist23','dist14','dist45'});
set(gca,'ytickLabel',{'Max','Mean','Min'});
zlabel('Difference(in points)');
for this particular plot i want to display the value of the respective bar above the respective bar. I have tried the following code but have failed
txt=num2str(x);
xt=get(gca,'xtickLabel',{'dist12','dist23','dist14','dist45'});
yt=get(gca,'ytickLabel',{'Max','Mean','Min'});
text(xt,yt,txt);
please
please help me out with a solution.untitled.jpg

回答 (1 件)

YT
YT 2018 年 11 月 26 日
I would suggest you read this answer, which I think is pretty similar to your case.

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by