Why is MATLAB not making multiple plots when I specify separate figures?

18 Ansichten (letzte 30 Tage)
Guy am 10 Mär. 2023
Beantwortet: Image Analyst am 10 Mär. 2023
Hello, I am attemping to plot two separate sets of data on two different figure windows. I used the following code:
plot(theta, p);
plot(theta, T);
But only figure 1 is showing up. I have looked through this forum and I haven't seen any solutions, so some help would be greatly appreciated.

Antworten (2)

Voss am 10 Mär. 2023
Bearbeitet: Voss am 10 Mär. 2023
makes Figure 2 the current figure, if it exists, or creates a new figure called Figure 2 if it does not already exist and makes it the current figure.
It may be that Figure 2 already exists and its Position is outside the range of your monitor(s) or it's very small and you don't notice it.
Regardless, if you want to create a new figure, use
So this
plot(theta, p);
plot(theta, T);
would create two new figures, each with the their own plot(s).
  1 Kommentar
Guy am 10 Mär. 2023
Great, it's working now. I think I just needed to restart MATLAB. Thank you for your help though.

Melden Sie sich an, um zu kommentieren.

Image Analyst
Image Analyst am 10 Mär. 2023
You could put
close all
at the beginning of your script to close all windows. It should work then, though I'm not sure why it didn't work in the first place.

Community Treasure Hunt

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

Start Hunting!

Translated by