In [1]:
%matplotlib notebook
import matplotlib.pyplot as plt
import numpy as np
In [2]:
# Naredimo sto tock med 0 in 1
x = np.linspace(0, 1, 100)
In [3]:
# Narisemo tri krivulje na isti graf
plt.plot(x, x, label='linear')
plt.plot(x, x**2, label='quadratic')
plt.plot(x, x**3, label='cubic')
Out[3]:
In [4]:
# Oznacimo osi
plt.xlabel('x label')
plt.ylabel('y label')
Out[4]:
In [5]:
# Dolocimo naslov grafa
plt.title("Simple Plot")
Out[5]:
In [6]:
# Dolocimo naslov grafa
plt.title("Simple Plot")
Out[6]:
In [7]:
# Narisemo legendo
plt.legend()
Out[7]: