每一个错误的经验积累,就是通向成功的阶梯。
Each mistake I made shall become one of the stairs towards success.
Wednesday, 9 September 2015
Visualize Data Density on 1 Dimension Axis
This source code clip is for visulizing data density on 1 axis like the following:
# reference:
# http://stackoverflow.com/questions/7352220/how-to-plot-1-d-data-at-given-y-value-with-pylab
import numpy as np
import matplotlib.pyplot as pp
import random
val = 0. # this is the value where you want the data to appear on the y-axis.
ar = np.random.random(size=40)
pp.plot(ar, np.zeros_like(ar) + val, '+')
pp.show()
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment