How to plot pie chart in Matlab GUI using buttons?
2 次查看(过去 30 天)
显示 更早的评论
Hi again,
I have 3 buttons named "Weekone", "Month" "Year" - I want to plot 3 pie charts using axes when the buttons are pressed.
Here's my code below:
function weekone_Callback(hObject, eventdata, handles)
X = categorical ({'Present','Absence'});
explode = {'Absence'};
Labels = {'91%','9%'};
axes(handles.axes3);
pie(X,explode,labels);
I get the following error:
Unrecognized function or variable 'labels'.
Error in myprofile>weekone_Callback (line 281)
pie(X,explode,labels);
0 个评论
采纳的回答
Adam Danz
2020-4-6
Hint: "Labels" is not the same as "labels". Variable names are case sensitive.
3 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Pie Charts 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!