Created
June 8, 2021 15:32
-
-
Save srdg/f258b1b937736c8374f70ac21ba14308 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 | |
%matplotlib inline | |
c = plt.hist(np.random.rand(500), bins=30, color='yellow', edgecolor='black') | |
plt.figure() | |
x, y = sorted([round(i,2) for i in c[1][:-1]] ), sorted(c[0]) | |
d = {} | |
for i in range(len(x)): | |
d[str(x[i])] = y[i] | |
plt.xticks([]) | |
plt.yticks([]) | |
_=plt.bar(d.keys(), d.values(), color='yellow', edgecolor='black') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment