How to show both value and percentage in a piechart
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Yajie Liang
am 15 Apr. 2020
Kommentiert: Ameer Hamza
am 17 Apr. 2020
Hi, I googled a while but did not find a good resolution. Is there a simple way to do that? thanks
0 Kommentare
Akzeptierte Antwort
Ameer Hamza
am 15 Apr. 2020
Try this
X = [1/3 2/3];
value = compose(['Val=%.3f'], X);
percents = compose([newline 'P=%.3f%%'], X/sum(X)*100);
pie(X, strcat(value, percents))
2 Kommentare
Weitere Antworten (0)
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!