How can I write a push button to plot hist3 on view2 via axes in GUI using GUIDE?

1 view (last 30 days)
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

Accepted Answer

Sahithi Kanumarlapudi
Sahithi Kanumarlapudi on 21 Apr 2020
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

More Answers (0)

Products


Release

R2018b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!