pyplot
Visualization basics
import numpy as np
import matplotlib.pyplot as plt
x = np.arange(0, 5, 0.1)
y = np.sin(x)
plt.plot(x, y)
plt.show()Here is the output.
Scatter plot
Scatter plotimport matplotlib.pyplot as plt
x = [1, 2, 3, 4]
y = [3, 4, 8, 6]
colors = (0, 0, 0)
plt.scatter(x, y, c=colors, alpha=0.5)
plt.title('Scatter plot')
plt.xlabel('x')
plt.ylabel('y')
plt.show()
Last updated
