Created
March 20, 2017 13:23
-
-
Save edib/152e0467a029464f0edec2e2e1c62ca2 to your computer and use it in GitHub Desktop.
draw graph with numpy and matplotlib
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
| from matplotlib import pyplot as plt | |
| from matplotlib import style | |
| import numpy as np | |
| # print(style.available) | |
| #['seaborn-colorblind', 'seaborn-poster', 'grayscale', 'ggplot', 'seaborn-darkgrid', 'seaborn', 'seaborn-ticks', 'seaborn-white', 'seaborn-notebook', 'seaborn-whitegrid', 'seaborn-dark-palette', 'bmh', 'dark_background', 'seaborn-dark', 'seaborn-pastel', 'seaborn-muted', 'seaborn-paper', 'seaborn-talk', 'classic', 'seaborn-deep', 'seaborn-bright', 'fivethirtyeight'] | |
| style.use('ggplot') | |
| x,y = np.loadtxt('data.csv',unpack=True,delimiter=',') | |
| """ data.csv | |
| 1,20 | |
| 2,30 | |
| 3,40 | |
| 4,10 | |
| 5,20 | |
| 6,30 | |
| 7,40 | |
| 8,10 | |
| 9,20 | |
| 10,30 | |
| 11,40 | |
| 12,10 | |
| """ | |
| plt.plot(x,y) | |
| plt.title('Epic Chart') | |
| plt.ylabel('Y Axis') | |
| plt.xlabel('X Axis') | |
| plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment