Want to plot a table that has both text and numbers into a pie chart
4 views (last 30 days)
Show older comments
I have a table that has both text and numerical values:
{'Alabama' } {[ 227433]}
{'Alaska' } {[ 12107]}
{'Arizona' } {[ 193063]}
{'Arkansas' } {[ 138372]}
{'California' } {[ 1141776]}
How can I label the values in a pie chart with their corresponding state?
I am unable to plot the pie chart as 'pie(raw)' as I need 'numeric data in the pie chart.'
0 Comments
Accepted Answer
KSSV
on 12 Feb 2019
T = [{'Alabama' } {[ 227433]}
{'Alaska' } {[ 12107]}
{'Arizona' } {[ 193063]}
{'Arkansas' } {[ 138372]}
{'California' } {[ 1141776]}] ;
X = cell2mat(T(:,2)) ;
labels = T(:,1) ;
pie(X,labels)
0 Comments
More Answers (0)
See Also
Categories
Find more on Pie Charts in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!