Created
September 18, 2022 14:23
-
-
Save saaeiddev/1915f32ad87b68f807814f0c8e536de4 to your computer and use it in GitHub Desktop.
matplotlib
charts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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