findall doesn't find axes object
3 次查看(过去 30 天)
显示 更早的评论
I have an app that creates a TabGroup and inside it some tabs that contain a plot. If the specific tab exists, I would like to plot on top of the existing plot. However, when using findall to find the axes that were created but I get a 0×0 empty GraphicsPlaceholder array. What am I missing?
tabs = get(TabGroup,'Children');
tab_names = arrayfun(@(tab) tab.Title,tabs,'UniformOutput',false);
if (~ismember('Station',tab_names))
station_tab = uitab(TabGroup,'Title','Station');
station_tab.Tag = "Station";
station_tab.AutoResizeChildren = 'off';
station_ax_Tt = subplot(2,1,1,'Parent',station_tab);
station_ax_Tt.Tag = "ax_Tt";
station_ax_Pt = subplot(2,1,2,'Parent',station_tab);
station_ax_Pt.Tag = "ax_Pt";
plot_stations(station_tab,station_ax_Tt,Tt,station_ax_Pt,Pt,Nm);
else
station_tab = findall(groot,'Tag',"Station");
station_ax_Tt = findall(groot,'Tag', "ax_Tt");
station_ax_Pt = findall(groot,'Tag', "ax_Pt");
plot_stations(station_tab,station_ax_Tt,Tt,station_ax_Pt,Pt,Nm);
end
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Line Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!