Blank histogram plot window
6 views (last 30 days)
Show older comments
Hello,
I have a matrix full of data. I am interested in plotting a histogram of one column of said data. The number of rows in the data is 195,104. This minimum and maximum of the data series are -8.8317e+181 and Infinity, respectively.
Whenever I attempt to plot a histogram of the results, the plot window appears to be empty. Is there a way to properly plot this data? I am not necessarily interested in the outlier values, but more so in the range of -20 to 20. I have tried to limit the x-axis to this range, but the plot sill appears to be empty.
Thank you,
Kevin
1 Comment
Image Analyst
on 27 Jun 2012
It could be that there were lots of outliers - more than any valid values so the y range is huge, compressing all your histogram bars vertically. You may have needed to set ylim() also, in addition to xlim(). But actually, I tlawren's answer better.
Accepted Answer
tlawren
on 26 Jun 2012
If you are not interested in outliers (data outside of [-20,20]), then set all outliers to NaN's. Something like the following should work.
M(abs(M) > 20) = NaN;
hist(M(:,col));
where M is your data matrix and col is the column you want to plot.
Inf's will cause empty histograms.
More Answers (0)
See Also
Categories
Find more on Data Distribution Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!