From e664e677e2782c74dde17dbeded2c7a53366069f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9C=5BJMF=5D=E2=80=9D?= Date: Sat, 17 Dec 2022 16:35:04 +0100 Subject: [PATCH] add script --- scripts/exp-imp.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 scripts/exp-imp.py diff --git a/scripts/exp-imp.py b/scripts/exp-imp.py new file mode 100644 index 0000000..2f8d3ad --- /dev/null +++ b/scripts/exp-imp.py @@ -0,0 +1,22 @@ +import numpy as np +import matplotlib.pyplot as plt + +x= np.linspace(0,2*np.pi) +y= np.sin(x) + +# implicity +plt.plot(x,y,label="sin") +plt.xlabel('x label') +plt.ylabel('y label') +plt.title("Simple Plot") +plt.legend() +plt.show() + +# explicity +fig = plt.figure(figsize=(6,6)) +ax = plt.subplot(aspect=1) +ax.plot(x,y,label="sin") +ax.set_xlabel('x') # Add an x-label to the axes. +ax.set_ylabel('y') # Add a y-label to the axes. +ax.set_title("Simple Plot") # Add a title to the axes. +ax.legend() # Add a legend.