Created
November 12, 2017 03:46
-
-
Save kylefritz/ce7ba26d24aeb79ac348cf3654c1067a to your computer and use it in GitHub Desktop.
Basic Plotting on jupyter notebook
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 pandas as pd | |
import matplotlib.pyplot as plt | |
import numpy as np | |
%matplotlib inline | |
x = np.linspace(0, 10, 100) | |
y = np.cos(x) | |
plt.plot(x,y) | |
grid = np.zeros((20,20)) | |
grid[5,5] = 100 | |
grid[2,8] = 50 | |
grid[19,1] = 50 | |
grid[10,10] = 30 | |
# math uses origin bottom left but images use top left. transpose & set origin to get that behavior | |
plt.imshow(np.transpose(grid), cmap='GnBu',interpolation='none', origin='lower') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment