using app designer, am trying to plot in new figure once the checkbox for that is selected.

1 Ansicht (letzte 30 Tage)
function PLOTButtonPushed(app, event)
figure;
plot(x, y, 'Color', str_color); %plot graph
title(app.EditField.Value);
end
this function starts ploting from figure 2 not 1 ans so on. and i want that each time i press the plot button it should plot again in new figure (continuing from last figure) and s on.
  1 Kommentar
Johannes Hougaard
Johannes Hougaard am 19 Aug. 2021
I can't recreate your problem unfortunately.
In this app all I've done is to make the button you describe - and it works as you describe that the first figure is figure 1, the next is figure 2 etc.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Himanshu Jain
Himanshu Jain am 24 Aug. 2021
Do you want the plot to replace what is already there and keep the same axes? You can do it in the following way.
h1 = figure;
plot(randn(100,1));
figure(h1)
ax = gca;
plot(ax,randn(100,1),'r');
Or do you want the plot to be in addition to what is there with the same axes? In this case you can use 'hold on' functionality and do it in the following way.
h1 = figure;
plot(randn(100,1));
figure(h1)
ax = gca; hold on;
plot(ax,randn(100,1),'r');

Kategorien

Mehr zu Graphics Object Properties finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by