This guide covers basic to advanced visualizations using Matplotlib and Seaborn. Each snippet is explained clearly with expected output behavior.
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
%matplotlib inline
x = np.linspace(0, 5, 11)
y = x ** 2x # view xy # view y
plt.plot(x, y, 'r')
plt.xlabel('x axis title')
plt.ylabel('y axis title')
plt.title('First visual')
plt.show()
plt.subplot(1, 2, 1)
plt.plot(x, y, 'r--')
plt.subplot(1, 2, 2)
plt.plot(x, y, 'g*-')
plt.show()
plt.plot(x, x**2, label='x**2')
plt.plot(x, x**3, label='x**3')
plt.legend()
plt.show()
tips = sns.load_dataset('tips')
tips.head()