Matplotlib plt.plot basics¶
Simple line plots and basic properties.
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
X = np.linspace(0,10,100)
y = np.sin(X)
plt.plot(X, y)
plt.show()
Set line color, line weight, transparency¶
plt.plot(X, y, c='r', linewidth = 5, alpha = 0.5)
plt.show()
Set axis limit, label, and figure title¶
plt.plot(X, y, c='r', linewidth = 5, alpha = 0.5)
plt.xlim(-3, 13)
plt.ylim(-2, 2)
plt.xlabel('X')
plt.ylabel('y')
plt.title('some sine wave')
plt.show()