Created
October 29, 2019 16:05
-
-
Save Hazza4569/a49c1446e25ac2653d90395ab5646ee2 to your computer and use it in GitHub Desktop.
This file contains 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 numpy as np | |
import matplotlib.pyplot as plt | |
nbins = 25 | |
delr=[0, 10]; delv = [0,10] | |
# np.meshgrid might be better here instead of this x,y stuff | |
rngex = np.linspace(min(delr),max(delr),nbins+1) | |
rngey = np.linspace(min(delv),max(delv),nbins+1) | |
x, y = np.meshgrid(rngex[:-1],rngey[:-1]) | |
x = x.flatten() | |
y = y.flatten() | |
print(f"{x}\n{y}") | |
plt.hist2d(x,y,bins=[rngex,rngey]) | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment