Continues update of figure with new data entered mannually from GUI
1 回表示 (過去 30 日間)
古いコメントを表示
SatyaPrakash Gupta
2019 年 11 月 26 日
編集済み: SatyaPrakash Gupta
2019 年 11 月 26 日
Hi,
I am beginner to MatLab and have one question as below:
Question :
- i have 2 matlab script file , one has GUI and the other has normal function definition for plotting the figure. when my GUI opens, in the edit text box, i enter the value and my function works accordingly i.e figure get plotted.
Problem : everytime when i update the text box, each time new figure gets open and there are nearly 8 figures, how can i update the figures when new text data is provided ?
Please note : i use scatter, gscatter, dbscan etc for each figure to get plotted
Your feedback will help me out to procced with my current activity.
thank you and waiting for your feedback.
Regards,
Satya
0 件のコメント
採用された回答
Jakob B. Nielsen
2019 年 11 月 26 日
Welcome to the wonderous world of GUIs :)
You can label your figures. Normalized units can be changed to pixels, inches, centimeters etc. and you change the backmost numbers accordingly.
Then, when you plot something in your function, state which figure to update by calling the figure label. You can add as many figures into the same GUI as you want, and as long as you give them different "names", you can easily specify when to update what.
MYGUI=figure('toolbar','figure','MenuBar','none','Name','Sample GUI','NumberTitle','off','Color',[0.85 0.85 0.85],'Units', 'points','Position',[10 , 0, 1135 , 530 ]);
%This labels your GUI, and its name is now "MYGUI".
%That way, you define the figure "MyFigure" to belong to the "MYGUI" parent.
MyFigure = axes('Parent', MYGUI,'Units', 'normalized','HandleVisibility','callback','Position',[0.05,0.50,0.42,0.10]);
%And now, make a plot, add a legend, and label the y-axis on the figure you just labelled "MyFigure".
plot(MyFigure,x_data1,y_data1,'r-',x_data2,y_data2,'b-');
lgnd1=legend(MyFigure,'Sample data 1','Sample data 2','Location','SouthWest');
ylabel(MyFigure,'This label goes on "MyFigure"','FontSize',11,'Interpreter','latex');
1 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Call Python from MATLAB についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!