How can I write a push button to plot hist3 on view2 via axes in GUI using GUIDE?
1 次查看(过去 30 天)
显示 更早的评论
Hi All,
Please consider the following code lines that work properly in command window and outside of the GUI environment:
SC=rand(10000,2);
hist3([SC(:,1) SC(:,2)],'CdataMode','auto','Nbins',[60 60]);view(2);colorbar;
How can I write GUI codes as a push button's Callback function in the myGUI.m file to run this through the axes?
I face with the following errors:
*Error using matlab.ui.container.Panel/set
There is no renderer property on the Panel class.
**Error in hist3 (line 301)
set(get(cax,'parent'),'renderer','zbuffer');
***Error in my_gui>push_button_Callback (line 1875)
hist3(handles.axes1,[SC(:,1) SC(:,2)],'CdataMode','auto','Nbins',[60 60]);view(2);colorbar;
Thank you in advance
0 个评论
采纳的回答
Sahithi Kanumarlapudi
2020-4-21
Hi,
As far as I understand it, your intention is to run the two commands that you have mentioned in the question on pressing a Push Button. You could do that by using the 'ButtonPushedFcn'. For more info on that refer to the following link
If you want to plot inside the GUI, you have to specify the 'Parent' property of histogram and colorbar.
For more information on how to do that refer to the following links
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Annotations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!