Skip to content

Instantly share code, notes, and snippets.

@saaeiddev
Created September 18, 2022 14:23
Show Gist options
  • Select an option

  • Save saaeiddev/1915f32ad87b68f807814f0c8e536de4 to your computer and use it in GitHub Desktop.

Select an option

Save saaeiddev/1915f32ad87b68f807814f0c8e536de4 to your computer and use it in GitHub Desktop.
matplotlib charts
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()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment