-
-
Save amarion35/9cd07e32f3cb5099f4c249aa3792aaaf to your computer and use it in GitHub Desktop.
matplotlib is for the weaks
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
| def plot(array, width, height): | |
| size = len(array) | |
| y = [array[int(round(k*size/width)):int(round((k+1)*size/width))] for k in range(width)] | |
| y = [np.mean(k) for k in y[5:]] #y[5:] when the firsts values are too big | |
| y = height*(y-np.min(y))/(np.max(y)-np.min(y)) | |
| res = np.array(list([list('#'*int(round(y[k]))+' '*int(round(height-y[k]))) for k in range(len(y))])) | |
| res = np.rot90(res, k=1, axes=(0,1)) | |
| for r in res: | |
| print(''.join(r)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment