Plot a list of numbers
Python 2, 118 bytes
Saving 2 bytes thanks to Shebang
def f(n,L):
for i in range(n):print''.join(' #'[i==j]for j in[n-1-int(~-n*(x-min(L))/(max(L)-min(L))+0.5)for x in L])
Mathematica, 91 bytes
StringRiffle[(Join[" "~Table~#,{"#"},Table[" ",a-#]]&/@⌊(a=#2-1)Rescale@#⌋),"
",""]&
Anonymous function. The Unicode characters are respectively U+230A LEFT FLOOR for \[LeftFloor]
, U+230B RIGHT FLOOR for \[RightFloor]
, and U+F3C7 (private use) for \[Transpose]
. Output for the test case:
#
## ##
# #
# #
# #
# #
# #
#####