How to plot multiple graphs by a GUI callback function?
Show older comments
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
Answers (0)
Categories
Find more on Develop Apps Programmatically in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!