Set an x-axis of a histogram in matlab to get a subset of the histogram -
i have histogram plotted in matlab , want work section of histogram. have found how change x-axis overall, plots entire histogram on new axis instead of pulling subset of histogram. there way work section of histogram selecting x-axis?
you can plot of histogram want choosing subsection of matrix,
bins = 100 xmin = 40 xmax = 60 [f,x]=hist(randn(1000000,1),bins); bar(x(xmin:xmax),f(xmin:xmax))
alternatively, can plot on specified range of x bin values,
xvalues = -1:0.1:0.9; [f,x]=hist(randn(1000000,1),xvalues); bar(x,f,'b')
but values outside range collected in bins @ either end if range.
Comments
Post a Comment