add script

This commit is contained in:
“[JMF]” 2022-12-17 16:35:04 +01:00
parent 239432b2a5
commit e664e677e2
1 changed files with 22 additions and 0 deletions

22
scripts/exp-imp.py Normal file
View File

@ -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.