OneCompiler

matplotlib

212

#python

import matplotlib.pyplot as plt
import numpy as np

xpoints = np.array([3 , 6])
ypoints = np.array([7 , 12])
zpoints = np.array([5 , 14])

plt.plot(xpoints , ypoints , zpoints)
plt.show()

y = np.array([30, 25, 20, 15])

plt.pie(y)
plt.show()

z = np.array([35, 25, 25, 15])
mylabels = ["Apple", "Google", "Microsoft", "Samsung"]

plt.pie(y, labels = mylabels)
plt.show()

theta = np.linspace(0, 2*np.pi)
x = np.cos(theta - np.pi/2)
y = np.sin(theta - np.pi/2)
z = theta

fig, ax = plt.subplots(subplot_kw=dict(projection='3d'))
ax.stem(x, y, z)

plt.show()