diff --git a/main.py b/main.py index 42ae358..896e67e 100644 --- a/main.py +++ b/main.py @@ -1,8 +1,9 @@ import matplotlib.pyplot as plt import numpy as np +import sys class Plot: - def __init__(self): + def __init__(self, n): self.fig, self.ax = plt.subplots() self.cid_click = self.fig.canvas.mpl_connect('button_press_event', self.onclick) @@ -17,7 +18,7 @@ class Plot: self.curvePoints = [] self.isDrawing = False self.inputMode = 0 - self.n = 15 + self.n = n def onclick(self, event): if self.inputMode == 0: @@ -63,7 +64,10 @@ class Plot: def run(self): plt.show() +n = 10 +if len(sys.argv) > 1: + n = int(sys.argv[1]) if __name__ == "__main__": - plot = Plot() + plot = Plot(n) plot.run()