12 lines
274 B
Python
12 lines
274 B
Python
import matplotlib.pyplot as plt
|
|
|
|
|
|
def simple_plot(x: list, y: list, show_window: bool = False, filename: str = "plot.png") -> None:
|
|
plt.plot(x, y)
|
|
plt.savefig(filename)
|
|
|
|
if show_window:
|
|
# blocks until window is closed
|
|
plt.show()
|
|
|
|
plt.close()
|