matplotlib - Python - Removing vertical bar lines from histogram -
i'm wanting remove vertical bar outlines histogram plot, preserving "etching" of histogram, if makes since.
import matplotlib.pyplot plt import numpy np bins = 35 fig = plt.figure(figsize=(7,6)) ax = fig.add_subplot(111) ax.hist(subvel_hydro1, bins=bins, facecolor='none', edgecolor='black', label = 'pecuiliar vel') ax.set_xlabel('$v_{_{b|a}} $ [$km\ s^{-1}$]', fontsize = 16) ax.set_ylabel(r'$p\ (r_{_{b|a}} )$', fontsize = 16) ax.legend(frameon=false)
giving
is doable in matplotlibs histogram functionality? hope provided enough clarity.
in pyplot.hist()
set value of histtype = 'step'
. example code:
import matplotlib mpl import matplotlib.pyplot plt import numpy np x = np.random.normal(0,1,size=1000) fig = plt.figure() ax = fig.add_subplot(111) ax.hist(x, bins=50, histtype = 'step', fill = none) plt.show()
sample output:
Comments
Post a Comment