How to plot multiple graphs by a GUI callback function?

2 次查看(过去 30 天)
Hi, thank you always for your support.
On a GUI window, I am trying to plot multiple graphs from a matrix form, each column of which is a data to be plotted.
I wrote a callback function as below, but the handler could plot just one graph in each call back.
Is there any good way to circumvent this?
Thank you in advance:)
hp = uipanel('Title','title','FontSize',12, 'FontWeight', 'bold',...)
handler.haxp = axes('Units','normal', 'Position', [...], 'Parent', hp);
handler.plot_handle = plot(handler.haxp, x, data);hold(handler.haxp,'on');
handler.plot_handle = plot(handler.haxp, x(1), data(1), 'xr','linewidth',2);
set(get(handler.haxp_image,'Children'),'ButtonDownFcn',@plot_graph);
function plot_graph(varargin):
set(hh.plot_handle, 'YData', data); hold(hh.haxp, 'on')
end

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 2-D and 3-D Plots 的更多信息

产品


版本

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by