using app designer, am trying to plot in new figure once the checkbox for that is selected.
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentario
Johannes Hougaard
el 19 de Ag. de 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.
Respuestas (1)
Himanshu Jain
el 24 de Ag. de 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');
0 comentarios
Ver también
Categorías
Más información sobre Line Plots en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!