MATLAB Answers

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

3 ビュー (過去 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

採用された回答

Sahithi Kanumarlapudi
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 件)

製品


リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by