how to plot histogram
1 view (last 30 days)
I wanted to plot the histogram of the attached data with number of bins = 42
When i use
I get just 2 vertical lines at 0 and 1.
Instead, how can i get histogram with number of bins 42, or is the below code correct?
h = histogram(HRGB,42);
Or is there a better way to plot the histogram of the attached data?
Chunru on 2 Jun 2022
imhist assumes Xdata in the range of [0,1]. Therefore you have only two bins for 0 & 1 with your data
You can rescale the data:
Or you can use hist