How to show both value and percentage in a piechart
    조회 수: 6 (최근 30일)
  
       이전 댓글 표시
    
Hi,  I googled a while but did not find a good resolution. Is there a simple way to do that? thanks
댓글 수: 0
채택된 답변
  Ameer Hamza
      
      
 2020년 4월 15일
        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))
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!