Enkel plotting i Python
Eksempel:
from matplotlib import pyplot as plt
=[0, 1, 2, 3]
U=[0, 0.02, 0.04, 0.06]
I
"I/V plot")
plt.title("Voltage (V)")
plt.xlabel("Current (A)")
plt.ylabel(
plt.plot(U,I)
plt.scatter(U,I)
plt.grid() plt.show()
Plotting av funksjoner, eksempel:
from matplotlib import pyplot as plt
import numpy as np
= np.linspace(0,2,100)
t = np.sin(2*t)
Y1 = 0.2*np.sin(t)
Y2
"Funksjonsplott")
plt.title("Tid (sec)")
plt.xlabel("Spenning (V)")
plt.ylabel(='Y1')
plt.plot(t,Y1, label='Y2')
plt.plot(t,Y2, label
plt.legend()
plt.grid() plt.show()