Enkel plotting i Python

Eksempel:

from matplotlib import pyplot as plt

U=[0, 1, 2, 3]
I=[0, 0.02, 0.04, 0.06]

plt.title("I/V plot")
plt.xlabel("Voltage (V)")
plt.ylabel("Current (A)")
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

t = np.linspace(0,2,100)
Y1 = np.sin(2*t)
Y2 = 0.2*np.sin(t)

plt.title("Funksjonsplott")
plt.xlabel("Tid (sec)")
plt.ylabel("Spenning (V)")
plt.plot(t,Y1, label='Y1')
plt.plot(t,Y2, label='Y2')
plt.legend()
plt.grid()
plt.show()