Bind plot with some figure

4 次查看(过去 30 天)
Rajiv Kumar
Rajiv Kumar 2018-6-19
回答: OCDER 2018-6-19
I want to plot multiple plots on a figure. My flow is like below figure()//creates figure 1 h = figure() // creates figure 2 for(){ do Calculations; figure(h); plot();//should always plot on figure 2 }
Problem is if user manually moves focus from current figure1 to figure2 then it starts plotting on figure1.
Please suggest so plot() is drawn always on figure 2, irrespective of user moving focus from figure 2 to figure 1.
I have multiple figures like figure1, figure2, figure3 etc and cant stop user to move from one figure to another while above loop is plotting

采纳的回答

OCDER
OCDER 2018-6-19
In this case, you should specify which axes to plot on. See the example below:
%Initialize the figures
Gx = gobjects(1, 4);
Ax = gobjects(1, 4);
for k = 1:4
Gx(k) = figure(k);
Ax(k) = axes(Gx(k));
end
%Plot to the Nth figure
for k = 1:4
plot(Ax(k), rand(1, 10), rand(1, 10));
^ INCLUDE AXES HERE! %To plot to 1st figure, use Ax(1). 2nd figure, use Ax(2). etc.
end

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Creating, Deleting, and Querying Graphics Objects 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by