Usually when I plot in MATLAB, it always draws on the same figure. How do I make it draw in a new figure?
I know it is pretty elementary, but I'm not finding it using Google Search.
Create a New Figure Using the figure() Function in MATLAB If you want to plot data on multiple figures, you can use the figure() function to create a new figure and plot data there. To plot multiple figures using figure() , you just need to define the number of the figure inside this function.
The easy workaround is to just use the command "figure" before you plot. just created figures 6 and 7 with your desired plots and left your previous plots 1-5 alone.
You can display multiple axes in a single figure by using the tiledlayout function. This function creates a tiled chart layout containing an invisible grid of tiles over the entire figure.
figure( n ) finds a figure in which the Number property is equal to n , and makes it the current figure. If no figure exists with that property value, MATLAB® creates a new figure and sets its Number property to n .
figure; plot(something);
or
figure(2); plot(something); ... figure(3); plot(something else); ...
etc.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With