I intend to plot the two graphs in separate windows, but they are overlaid on one window.
import matplotlib.pyplot as plt
a = [a for a in range(10)]
b = [-a for a in a]
a = plt.plot(a)
b = plt.plot(b)
plt.show()
Originally I want to display them in separate windows, but they are drawn as different lines in the same window. Blue line: a data Orange line: b data
If you want to create a new window and draw it, you need to execute plt.figure (). The plt.figure () method is the ability to draw a new window with nothing drawn.
import matplotlib.pyplot as plt
a = [a for a in range(10)]
b = [-a for a in a]
plt.figure() #Draw a new window
a = plt.plot(a)
plt.figure() #Draw a new window
b = plt.plot(b)
plt.show()
It is divided into two windows and displayed. Above graph: a data Bottom graph: b data
Recommended Posts